Class JDBCFeatureReader.ResultSetFeature
- All Implemented Interfaces:
Attribute,ComplexAttribute,Feature,Property,SimpleFeature
- Enclosing class:
- JDBCFeatureReader
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Just releasing references, not an actual "Closeable" closegetAttribute(int index) Gets an attribute value by index.getAttribute(String name) Gets an attribute value by name.getAttribute(Name name) Gets an attribute value by name.intThe number of attributes the feature is composed of.Returns a list of the values of the attributes contained by the feature.The bounds of this Feature, if available.Returns the value of the default geometry of the feature.The default geometric attribute of the feature.Override ofProperty.getDescriptor()which type narrows toAttributeDescriptor.The type of the feature.getID()Unique Identifier for the SimpleFeatureA unique identifier for the feature.getName()The name of the property with respect to its descriptor.Complete collection of properties.getProperties(String name) Returns a subset of the properties of the complex attribute which match the specified name.getProperties(Name name) Returns a subset of the properties of the complex attribute which match the specified name.getProperty(String name) Returns single property of the complex attribute which matches the specified name.getProperty(Name name) Returns single property of the complex attribute which matches the specified name.getType()Override and type narrow to SimpleFeatureType.A map of "user data" which enables applications to store "application-specific" information against a property.Collection<? extends Property>getValue()Override ofProperty.getValue()which returns the collection ofPropertywhich make up the value of the complex attribute.voidinit()voidbooleanisDirty(int index) booleanbooleanFlag indicating ifnullis an acceptable value for the property.voidsetAttribute(int index, Object value) Sets an attribute value by index.voidsetAttribute(String name, Object value) Sets an attribute value by name.voidsetAttribute(Name name, Object value) Sets an attribute value by name.voidsetAttributes(Object[] object) Sets the values of the attributes contained by the feature.voidsetAttributes(List<Object> values) Sets the values of the attributes contained by the feature.voidsetDefaultGeometry(Object defaultGeometry) Sets the value of the default geometry for the feature.voidsetDefaultGeometryProperty(GeometryAttribute defaultGeometry) Sets the default geometric attribute of the feature.voidvoidSets the value or content of the property.voidsetValue(Collection<Property> value) Sets the contained properties of the complex attribute.voidvalidate()Check the properties against the constraints provided by their AttributeDescriptors.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Property
hasUserData
-
Method Details
-
init
-
init
- Throws:
SQLExceptionIOException
-
getFeatureType
Description copied from interface:SimpleFeatureThe type of the feature.This method is a synonym for
SimpleFeature.getType().- Specified by:
getFeatureTypein interfaceSimpleFeature- See Also:
-
getType
Description copied from interface:SimpleFeatureOverride and type narrow to SimpleFeatureType.- Specified by:
getTypein interfaceAttribute- Specified by:
getTypein interfaceComplexAttribute- Specified by:
getTypein interfaceFeature- Specified by:
getTypein interfaceProperty- Specified by:
getTypein interfaceSimpleFeature- Returns:
- The feature type
- See Also:
-
getIdentifier
Description copied from interface:FeatureA unique identifier for the feature.getType().isIdentifiable()must returntrueso this value must not returnnull.Generation of the identifier is dependent on the underlying data storage medium. Often this identifier is not persistent. Mediums such shapefiles and database tables have "keys" built in which map naturally to persistent feature identifiers. But other mediums do not have such keys and may have to generate feature identifiers "on-the-fly". This means that client code being able to depend on this value as a persistent entity is dependent on which storage medium or data source is being used.
- Specified by:
getIdentifierin interfaceAttribute- Specified by:
getIdentifierin interfaceFeature- Returns:
- The feature identifier, never
null.
-
getID
Description copied from interface:SimpleFeatureUnique Identifier for the SimpleFeatureThis value is non-null and should be the same as getIdentifier().toString(). Please note that an ID may be provided
- Specified by:
getIDin interfaceSimpleFeature- Returns:
- A unique identifier for the attribute, or
nullif the attribute is non-identifiable.
-
setID
-
getAttribute
Description copied from interface:SimpleFeatureGets an attribute value by name.This method is a convenience for:
Property p = getProperty( name ); return p.getValue();
- Specified by:
getAttributein interfaceSimpleFeature- Parameters:
name- The name of the attribute whose value to retrieve.- Returns:
- The attribute value, or
nullif no such attribute exists with the specified name.
-
getAttribute
Description copied from interface:SimpleFeatureGets an attribute value by name.This method is a convenience for:
Property p = getProperty( name ); return p.getValue();
Since attribute names in simple features do not have a namespace uri this method is equivalent to calling
getAttribute(name.getLocalPart()).- Specified by:
getAttributein interfaceSimpleFeature- Parameters:
name- The name of the attribute whose value to retrieve.- Returns:
- The attribute value, or
nullif no such attribute exists with the specified name.
-
getAttribute
Description copied from interface:SimpleFeatureGets an attribute value by index.This method is a convenience for:
Property p = ((List)getProperties()).get( i ) ; return p.getValue();
- Specified by:
getAttributein interfaceSimpleFeature- Parameters:
index- The index of the attribute whose value to get.- Returns:
- The attribute value at the specified index.
- Throws:
IndexOutOfBoundsException- If the specified index is out of bounds.
-
setAttribute
Description copied from interface:SimpleFeatureSets an attribute value by name.This method is a convenience for:
Property p = getProperty( name ); p.setValue(value);
- Specified by:
setAttributein interfaceSimpleFeature- Parameters:
name- The name of the attribute whose value to set.value- The new value of the attribute.
-
setAttribute
Description copied from interface:SimpleFeatureSets an attribute value by name.This method is a convenience for:
Property p = getProperty( name ); p.setValue(value);
Since attribute names in simple features do not have a namespace uri this method is equivalent to calling
setAttribute(name.getLocalPart(), value).- Specified by:
setAttributein interfaceSimpleFeature- Parameters:
name- The name of the attribute whose value to set.value- The new value of the attribute.
-
setAttribute
Description copied from interface:SimpleFeatureSets an attribute value by index.This method is a convenience for:
Property p = ((List)getProperties()).get( i ) ; p.setValue(value);
- Specified by:
setAttributein interfaceSimpleFeature- Parameters:
index- The index of the attribute whose value to set.value- The new value of the attribute.- Throws:
IndexOutOfBoundsException- If the specified index is out of bounds.
-
setAttributes
Description copied from interface:SimpleFeatureSets the values of the attributes contained by the feature.The values must be in the order of the attributes defined by the feature type.
This method is a convenience for:
int i = 0; for ( Property p : getProperties() ) { p.setValue( values.get( i++ ) ); }- Specified by:
setAttributesin interfaceSimpleFeature- Parameters:
values- The attribute values to set.
-
getAttributeCount
public int getAttributeCount()Description copied from interface:SimpleFeatureThe number of attributes the feature is composed of.This is a convenience for:
return getAttributes().size();
- Specified by:
getAttributeCountin interfaceSimpleFeature- Returns:
- Number of attributes of the feature.
-
isDirty
public boolean isDirty(int index) -
isDirty
-
close
public void close()Just releasing references, not an actual "Closeable" close -
getAttributes
Description copied from interface:SimpleFeatureReturns a list of the values of the attributes contained by the feature.
This method is a convenience for:
List values = new ArrayList(); for ( Property p : getProperties(); ) { values.add( p.getValue() ); } return values;- Specified by:
getAttributesin interfaceSimpleFeature- Returns:
- List of attribute values for the feature.
-
getDefaultGeometry
Description copied from interface:SimpleFeatureReturns the value of the default geometry of the feature.This method is convenience for:
return getDefaultGeometryProperty().getValue();
- Specified by:
getDefaultGeometryin interfaceSimpleFeature- Returns:
- The default geometry, or
nullif no default geometry attribute exists.
-
setAttributes
Description copied from interface:SimpleFeatureSets the values of the attributes contained by the feature.The values must be in the order of the attributes defined by the feature type.
This method is a convenience for:
for ( Property p : getProperties() ) { p.setValue( values[i] ); }- Specified by:
setAttributesin interfaceSimpleFeature- Parameters:
object- The attribute values to set.
-
setDefaultGeometry
Description copied from interface:SimpleFeatureSets the value of the default geometry for the feature.This method is convenience for:
getDefaultGeometryProperty().setValue(geometry);
- Specified by:
setDefaultGeometryin interfaceSimpleFeature- Parameters:
defaultGeometry- The new default geometry value.
-
getBounds
Description copied from interface:FeatureThe bounds of this Feature, if available.This value is derived from any geometric attributes that the feature is composed of.
In the case that the feature has no geometric attributes this method should return an empty bounds, ie,
bounds.isEmpty() == true. This method should never returnnull.The coordinate reference system of the returned bounds is derived from the geometric attributes which were used to compute the bounds. In the event that the feature contains multiple geometric attributes which have different crs's, the one defined by
Feature.getDefaultGeometryProperty()should take precedence and the others should be reprojected accordingly. -
getDefaultGeometryProperty
Description copied from interface:FeatureThe default geometric attribute of the feature.This method returns
nullin the case where no such attribute exists.- Specified by:
getDefaultGeometryPropertyin interfaceFeature- Returns:
- The default geometry attribute, or
null.
-
setDefaultGeometryProperty
Description copied from interface:FeatureSets the default geometric attribute of the feature.This value must be an attribute which is already defined for the feature. In other words, this method can not be used to add a new attribute to the feature.
- Specified by:
setDefaultGeometryPropertyin interfaceFeature- Parameters:
defaultGeometry- The new geomtric attribute.
-
getProperties
Description copied from interface:ComplexAttributeComplete collection of properties.This method is a convenience method for calling (Collection
) getValue(). - Specified by:
getPropertiesin interfaceComplexAttribute- Returns:
- The complete collection of properties.
-
getProperties
Description copied from interface:ComplexAttributeReturns a subset of the properties of the complex attribute which match the specified name.The name parameter is matched against each contained
Property.getName(), those that are equal are returned.- Specified by:
getPropertiesin interfaceComplexAttribute- Parameters:
name- The name of the properties to return.- Returns:
- The collection of properties which match the specified name, or an empty collection if no such properties match.
-
getProperties
Description copied from interface:ComplexAttributeReturns a subset of the properties of the complex attribute which match the specified name.This method is a convenience for
ComplexAttribute.getProperties(Name)in whichName.getNamespaceURI()isnull.Note: Special care should be taken when using this method in the case that two properties with the same local name but different namespace uri exist. For this reason using
ComplexAttribute.getProperties(Name)is safer.- Specified by:
getPropertiesin interfaceComplexAttribute- Parameters:
name- The local name of the properties to return.- Returns:
- The collection of properties which match the specified name, or an empty collection if no such properties match.
- See Also:
-
getProperty
Description copied from interface:ComplexAttributeReturns single property of the complex attribute which matches the specified name.Note: This method is a convenience and care should be taken when calling it if more then a single property matches name. In such a case the first encountered property in which
Property.getName()is equal to name is returned, and no order is guaranteed.This method is a safe convenience for:
getProperties(name).iterator().next().In the event that no property matches the specified name
nullis returned.- Specified by:
getPropertyin interfaceComplexAttribute- Parameters:
name- The name of the property to return.- Returns:
- The property matching the specified name, or
null.
-
getProperty
Description copied from interface:ComplexAttributeReturns single property of the complex attribute which matches the specified name.This method is a convenience for
ComplexAttribute.getProperty(Name)in whichName.getNamespaceURI()isnull.Note: This method is a convenience and care should be taken when calling it if more then a single property matches name. In such a case the first encountered property in which
Property.getName()is matches name is returned, and no order is guaranteed.Note: Special care should be taken when using this method in the case that two properties with the same local name but different namespace uri exist. For this reason using
ComplexAttribute.getProperties(Name)is safer.- Specified by:
getPropertyin interfaceComplexAttribute- Parameters:
name- The local name of the property to return.- Returns:
- The property matching the specified name, or
null.
-
getValue
Description copied from interface:ComplexAttributeOverride ofProperty.getValue()which returns the collection ofPropertywhich make up the value of the complex attribute.- Specified by:
getValuein interfaceComplexAttribute- Specified by:
getValuein interfaceProperty- Returns:
- The value of the property.
-
setValue
Description copied from interface:ComplexAttributeSets the contained properties of the complex attribute.The values should match the structure defined by
getDescriptor().- Specified by:
setValuein interfaceComplexAttribute
-
getDescriptor
Description copied from interface:AttributeOverride ofProperty.getDescriptor()which type narrows toAttributeDescriptor.- Specified by:
getDescriptorin interfaceAttribute- Specified by:
getDescriptorin interfaceProperty- Returns:
- The attribute descriptor, may be null if this is a top level type
- See Also:
-
getName
Description copied from interface:PropertyThe name of the property with respect to its descriptor.This method is convenience for
getDescriptor().getName(). -
getUserData
Description copied from interface:PropertyA map of "user data" which enables applications to store "application-specific" information against a property.An example of information that may wish to be stored along with an attribute could be its srs information (in the case of a geometric attribute ).
GeometryAttribute attribute = ...; //set the crs CoordinateReferenceSystem crs = CRS.decode("EPSG:4326"); attribute.setCRS( crs ); //set the srs attribute.getUserData().put( "srs", "EPSG:4326" );- Specified by:
getUserDatain interfaceProperty- Returns:
- A map of user data.
-
isNillable
public boolean isNillable()Description copied from interface:PropertyFlag indicating ifnullis an acceptable value for the property.This method is convenience for
getDescriptor().isNillable().- Specified by:
isNillablein interfaceProperty- Returns:
trueif the value of the property is allowed to benull, otherwisefalse.
-
setValue
Description copied from interface:PropertySets the value or content of the property.The class of newValue should be the same as or a subclass of
getType().getBinding().newValue may be
nullifgetDescriptor().isNillable()istrue. -
validate
public void validate()Description copied from interface:ComplexAttributeCheck the properties against the constraints provided by their AttributeDescriptors.Please note this method checks minOccurs and maxOccurs information; and calls each Attribute.validate on each entry in turn (in order to check isNillable, binding and restrictions).
- Specified by:
validatein interfaceAttribute- Specified by:
validatein interfaceComplexAttribute
-