001 //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.4_testing/src/org/deegree/io/datastore/schema/MappedGeometryPropertyType.java $
002 /*----------------------------------------------------------------------------
003 This file is part of deegree, http://deegree.org/
004 Copyright (C) 2001-2009 by:
005 Department of Geography, University of Bonn
006 and
007 lat/lon GmbH
008
009 This library is free software; you can redistribute it and/or modify it under
010 the terms of the GNU Lesser General Public License as published by the Free
011 Software Foundation; either version 2.1 of the License, or (at your option)
012 any later version.
013 This library is distributed in the hope that it will be useful, but WITHOUT
014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016 details.
017 You should have received a copy of the GNU Lesser General Public License
018 along with this library; if not, write to the Free Software Foundation, Inc.,
019 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020
021 Contact information:
022
023 lat/lon GmbH
024 Aennchenstr. 19, 53177 Bonn
025 Germany
026 http://lat-lon.de/
027
028 Department of Geography, University of Bonn
029 Prof. Dr. Klaus Greve
030 Postfach 1147, 53001 Bonn
031 Germany
032 http://www.geographie.uni-bonn.de/deegree/
033
034 e-mail: info@deegree.org
035 ----------------------------------------------------------------------------*/
036 package org.deegree.io.datastore.schema;
037
038 import java.net.URI;
039
040 import org.deegree.datatypes.QualifiedName;
041 import org.deegree.io.datastore.schema.content.MappingField;
042 import org.deegree.io.datastore.schema.content.MappingGeometryField;
043 import org.deegree.model.crs.CRSFactory;
044 import org.deegree.model.crs.CoordinateSystem;
045 import org.deegree.model.crs.UnknownCRSException;
046 import org.deegree.model.feature.schema.GeometryPropertyType;
047
048 /**
049 * Representation of property types that contain spatial data with mapping (persistence)
050 * information.
051 *
052 * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider </a>
053 * @author last edited by: $Author: mschneider $
054 *
055 * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
056 */
057 public class MappedGeometryPropertyType extends GeometryPropertyType implements MappedPropertyType {
058
059 private boolean isIdentityPart;
060
061 private URI srs;
062
063 private CoordinateSystem cs;
064
065 private TableRelation[] tableRelations;
066
067 private MappingGeometryField mappingField;
068
069 /**
070 * Constructs a new instance of <code>MappedGeometryPropertyType</code> from the given
071 * parameters.
072 *
073 * @param name
074 * @param typeName
075 * @param type
076 * @param minOccurs
077 * @param maxOccurs
078 * @param isIdentityPart
079 * @param srs
080 * @param tableRelations
081 * @param mappingField
082 * @throws UnknownCRSException
083 */
084 public MappedGeometryPropertyType( QualifiedName name, QualifiedName typeName, int type,
085 int minOccurs, int maxOccurs, boolean isIdentityPart,
086 URI srs, TableRelation[] tableRelations,
087 MappingGeometryField mappingField ) throws UnknownCRSException {
088 super( name, typeName, type, minOccurs, maxOccurs );
089 this.isIdentityPart = isIdentityPart;
090 this.srs = srs;
091 this.srs = srs;
092 // TODO always check if this worked as expected
093 this.cs = CRSFactory.create( srs.toString() );
094 this.tableRelations = tableRelations;
095 this.mappingField = mappingField;
096 }
097
098 /**
099 * Returns whether this property has to be considered when two instances of the parent feature
100 * are checked for equality.
101 *
102 * @return true, if this property is part of the feature's identity, false otherwise
103 */
104 public boolean isIdentityPart() {
105 return this.isIdentityPart;
106 }
107
108 /**
109 * Returns the SRS of the property's geometry content.
110 *
111 * @return the SRS of the property's geometry content
112 */
113 public URI getSRS() {
114 return this.srs;
115 }
116
117 /**
118 * Returns the {@link CoordinateSystem} of the property's geometry content.
119 *
120 * @return the coordinate system of the property's geometry content
121 */
122 public CoordinateSystem getCS() {
123 return this.cs;
124 }
125
126 /**
127 * Returns the path of <code>TableRelation</code>s that describe how to get to the table
128 * where the content is stored.
129 *
130 * @return path of TableRelations, may be null
131 */
132 public TableRelation[] getTableRelations() {
133 return this.tableRelations;
134 }
135
136 /**
137 * Returns the {@link MappingField} that stores the geometry information.
138 *
139 * @return the MappingField that stores the geometry information
140 */
141 public MappingGeometryField getMappingField() {
142 return this.mappingField;
143 }
144 }