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