001 //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.4_testing/src/org/deegree/io/datastore/schema/MappedFeaturePropertyType.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 org.deegree.datatypes.QualifiedName;
039 import org.deegree.model.feature.schema.FeaturePropertyType;
040
041 /**
042 * Representation of property types that contain features with mapping (persistence) information.
043 *
044 * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider </a>
045 * @author last edited by: $Author: mschneider $
046 *
047 * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
048 */
049 public class MappedFeaturePropertyType extends FeaturePropertyType implements MappedPropertyType {
050
051 private boolean isIdentityPart;
052
053 private TableRelation[] tableRelations;
054
055 private MappedFeatureTypeReference containedFT;
056
057 private boolean isReferenceType;
058
059 private boolean allowExternalLinks;
060
061 /**
062 * Constructs a new instance of <code>MappedFeaturePropertyType</code> from the given parameters.
063 *
064 * @param name
065 * @param typeName
066 * @param type
067 * @param minOccurs
068 * @param maxOccurs
069 * @param isIdentityPart
070 * @param tableRelations
071 * @param containedFT
072 * @param isReferenceType
073 */
074 public MappedFeaturePropertyType( QualifiedName name, QualifiedName typeName, int type, int minOccurs,
075 int maxOccurs, boolean isIdentityPart, TableRelation[] tableRelations,
076 MappedFeatureTypeReference containedFT, boolean isReferenceType ) {
077 super( name, typeName, type, minOccurs, maxOccurs );
078 this.isIdentityPart = isIdentityPart;
079 this.tableRelations = tableRelations;
080 this.containedFT = containedFT;
081 this.isReferenceType = isReferenceType;
082 }
083
084 /**
085 * @param name
086 * @param typeName
087 * @param type
088 * @param minOccurs
089 * @param maxOccurs
090 * @param isIdentityPart
091 * @param tableRelations
092 * @param containedFT
093 * @param isReferenceType
094 * @param allowExternalLinks
095 */
096 public MappedFeaturePropertyType( QualifiedName name, QualifiedName typeName, int type, int minOccurs,
097 int maxOccurs, boolean isIdentityPart, TableRelation[] tableRelations,
098 MappedFeatureTypeReference containedFT, boolean isReferenceType,
099 boolean allowExternalLinks ) {
100 this( name, typeName, type, minOccurs, maxOccurs, isIdentityPart, tableRelations, containedFT, isReferenceType );
101 this.allowExternalLinks = allowExternalLinks;
102 }
103
104 /**
105 * Returns the {@link MappedFeatureTypeReference} to the feature type that is stored in this property.
106 *
107 * @return reference to the contained feature type
108 */
109 public MappedFeatureTypeReference getFeatureTypeReference() {
110 return this.containedFT;
111 }
112
113 /**
114 * Returns the path of {@link TableRelation}s that describe how to get to the table where the content is stored.
115 *
116 * @return path of TableRelations, may be null
117 */
118 public TableRelation[] getTableRelations() {
119 return this.tableRelations;
120 }
121
122 /**
123 * Returns whether this property has to be considered when two instances of the parent feature are checked for
124 * equality.
125 *
126 * @return true, if this property is part of the feature's identity
127 */
128 public boolean isIdentityPart() {
129 return this.isIdentityPart;
130 }
131
132 /**
133 * Returns whether this property is of type "gml:ReferenceType" (in which case it's content must be specified by an
134 * xlink:href attribute).
135 *
136 * @return true, if this property is of type "gml:ReferenceType", false otherwise
137 */
138 public boolean isReferenceType() {
139 return this.isReferenceType;
140 }
141
142 /**
143 * @return whether external links are allowed/stored
144 */
145 public boolean externalLinksAllowed() {
146 return allowExternalLinks;
147 }
148
149 }