Package org.gvsig.fmap.dal.feature
Interface FeatureAttributeDescriptor
- All Superinterfaces:
Cloneable,org.gvsig.tools.lang.Cloneable,org.gvsig.tools.dynobject.DynField,org.gvsig.tools.dynobject.DynField_LabelAttribute,org.gvsig.tools.dynobject.DynField_v2,org.gvsig.tools.util.LabeledValue<FeatureAttributeDescriptor>,org.gvsig.tools.persistence.Persistent,org.gvsig.json.SupportToJson,org.gvsig.tools.dynobject.Tagged
- All Known Subinterfaces:
EditableFeatureAttributeDescriptor
public interface FeatureAttributeDescriptor
extends org.gvsig.tools.dynobject.DynField_v2, org.gvsig.tools.util.LabeledValue<FeatureAttributeDescriptor>, org.gvsig.tools.persistence.Persistent, org.gvsig.json.SupportToJson
A feature attribute descriptor contains information about one of the
attributes in a feature, such as its name, data type or precision.
- Version:
- $Id$
- Author:
- gvSIG team
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gvsig.tools.dynobject.DynField_v2
org.gvsig.tools.dynobject.DynField_v2.AvailableValuesProvider -
Field Summary
Fields inherited from interface org.gvsig.tools.dynobject.DynField
ANY, CHOICE, RANGE, RELATION_TYPE_AGGREGATE, RELATION_TYPE_AGGREGATE_WITH_COMPOSITION, RELATION_TYPE_COLLABORATION, RELATION_TYPE_COLLABORATION_WITH_COMPOSITION, RELATION_TYPE_COMPOSITION, RELATION_TYPE_IDENTITY, RELATION_TYPE_NONE -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanIndicates whether this attribute accepts null values.Retrieve the value of the attribute "name".getAdditionalInfo(String infoName) Returns additional information of the attributeorg.gvsig.expressionevaluator.Expressionorg.gvsig.expressionevaluator.Expressionorg.gvsig.tools.dataTypes.CoercionReturn a Coercion to convert a value to the type of this attribute.org.gvsig.tools.dataTypes.CoercionContextReturn a CoercionContext for this attribute.getCopy()Returns a clone of this attribute descriptorReturns the name of this attribute's data type.If this attribute is of type Date, then this method returns the date format set by the data store.Return the default value coerced to the data type of attribute.intReturn the designated column normal maximum width in characters.org.gvsig.tools.evaluator.EvaluatorReturns an evaluator that will be used to calculate the value of this attributeGets the attribute emulator associattedFeatureAttributeEmulatorto this attribute.Gets if the attribute has aFeatureAttributeGetter.intIf this attribute is aGeometry, this method returns the specific geometry subtype, as defined inGeometry.SUBTYPES.intIf this attribute is aGeometry, this method returns the specific geometry type, as defined inGeometry.TYPES.org.gvsig.fmap.geom.type.GeometryTypeReturns theGeometryTypeof the attribute if it is a geometry.intgetIndex()Returns this attribute relative position within theFeature.org.gvsig.timesupport.IntervalgetLabelOfValue(Object value) Returns the Locale associated with this attribute.For attributes of typeDataTypes.DECIMAL, this returns the MathContext associated to this.intReturns the maximum number of occurrences of this attribute on a given feature.The vast majority of data sources and data consumers will only function with this value being one.intReturns the minimum number of occurrences of this attribute on a given feature.For attributes of typeDataTypes.OBJECT, this returns the JavaClassobject that class or interface that all values of this attribute can be cast to.intFor attributes of typeDataTypes.DECIMAL, this returns the maximum number of digits.String[]intReturns the rounding mode to use when a value is converted to the attribute's data type.intgetScale()For attributes of typeDataTypes.DECIMAL, this returns the maximum number of digits after the decimal point.intgetSize()Returns a number that indicates the size of this attribute.org.gvsig.crs.projection.lib.ProjectiongetSRS()If this attribute is aGeometry, this method returns its Spatial Reference System.getStore()Return the store associated to this attribute descriptor.booleanbooleanbooleanbooleanbooleanhasLabel()booleanbooleanbooleanReturns if value is created automatically by the sourcebooleanbooleanReturn true if the attribute has an evaluator o an emulator.booleanbooleanisInAvailableValues(Object valueToCheck) booleanbooleanReturn true if the attribute has and index in the table.booleanReturnstrueif this attribute forms all or part of the unique identifying value for the feature it is contained by.booleanisTime()Gets if the attribute is a temporal attribute.voidsetAvailableValuesExpression(String expression) setAvailableValuesExpression(org.gvsig.expressionevaluator.Expression expression) voidsetFeatureAttributeGetter(FeatureAttributeGetter featureAttributeGetter) Sets theFeatureAttributeGetterthat is used to update the presentation of a field.Methods inherited from interface org.gvsig.tools.lang.Cloneable
cloneMethods inherited from interface org.gvsig.tools.dynobject.DynField
coerce, getAvailableValues, getClassOfValue, getDataType, getDefaultValue, getDescription, getElementsType, getGroup, getMaxValue, getMinValue, getName, getOder, getSubtype, getTheTypeOfAvailableValues, getType, isContainer, isHidden, isMandatory, isPersistent, isReadOnly, setAvailableValues, setAvailableValues, setClassOfValue, setDefaultDynValue, setDefaultFieldValue, setDescription, setElementsType, setElementsType, setGroup, setHidden, setMandatory, setMaxValue, setMinValue, setOrder, setPersistent, setReadOnly, setSubtype, setTheTypeOfAvailableValues, setType, setType, validateMethods inherited from interface org.gvsig.tools.dynobject.DynField_LabelAttribute
getLabel, getShortLabel, setLabel, setShortLabelMethods inherited from interface org.gvsig.tools.dynobject.DynField_v2
copyFrom, getAvailableValues, getAvailableValuesMethod, getCalculatedValue, getCalculateMethod, getClassNameOfItems, getClassNameOfValue, getClassOfItems, getCoercedDefaultValue, getDefaultValueSupplier, getDynClassOfItems, getDynClassOfValue, getRelationType, getTags, getTypeOfItems, getValidateElements, isAvailableValuesCalculated, isCalculated, setAvailableValues, setCalculateMethod, setClassOfItems, setClassOfItems, setClassOfItems, setClassOfValue, setClassOfValue, setDefaultValueSupplier, setRelationType, setTypeOfItems, setValidateElementsMethods inherited from interface org.gvsig.tools.util.LabeledValue
getLabel, getValue, toStringMethods inherited from interface org.gvsig.tools.persistence.Persistent
loadFromState, saveToStateMethods inherited from interface org.gvsig.json.SupportToJson
toJson, toJson, toJsonBuilder, toJsonBuilder
-
Method Details
-
getCopy
FeatureAttributeDescriptor getCopy()Returns a clone of this attribute descriptor- Returns:
- FeatureAttributeDescriptor A new copy of this
-
getDataTypeName
String getDataTypeName()Returns the name of this attribute's data type.- Returns:
- a string containing the name of this attribute's data type.
-
getFullDataTypeName
String getFullDataTypeName() -
hasDataProfile
boolean hasDataProfile() -
getDataProfileName
String getDataProfileName() -
getDataProfile
DataProfile getDataProfile() -
getSize
int getSize()Returns a number that indicates the size of this attribute. See the documentation for the various constants ofDataTypesfor how to interpret this value. As an example, when the data type isDataTypes.STRING, this value indicates the maximum length of the string.- Returns:
- an
intindicating the size of the attribute.
-
getDisplaySize
int getDisplaySize()Return the designated column normal maximum width in characters.- Returns:
-
getPrecision
int getPrecision()For attributes of typeDataTypes.DECIMAL, this returns the maximum number of digits. For other types, this must always return zero.- Returns:
-
getScale
int getScale()For attributes of typeDataTypes.DECIMAL, this returns the maximum number of digits after the decimal point. For other types, this must always return zero.- Returns:
-
getMathContext
MathContext getMathContext()For attributes of typeDataTypes.DECIMAL, this returns the MathContext associated to this. For other types returnMathContext.UNLIMITED.- Returns:
-
getCoercionContext
org.gvsig.tools.dataTypes.CoercionContext getCoercionContext()Return a CoercionContext for this attribute.- Returns:
- the CoercionContext
-
getCoercion
org.gvsig.tools.dataTypes.Coercion getCoercion()Return a Coercion to convert a value to the type of this attribute.- Returns:
- the Coercion.
-
getRoundMode
int getRoundMode()Returns the rounding mode to use when a value is converted to the attribute's data type. It will only be used for Float, Double and Decimal data types.- Returns:
-
getLocale
Locale getLocale()Returns the Locale associated with this attribute. It is usually used to format and recognize dates and decimal numbers. The default Locale will beLocale. ENGLISH- Returns:
-
getObjectClass
Class getObjectClass()For attributes of typeDataTypes.OBJECT, this returns the JavaClassobject that class or interface that all values of this attribute can be cast to.- Returns:
-
getMinimumOccurrences
int getMinimumOccurrences()Returns the minimum number of occurrences of this attribute on a given feature. The vast majority of data sources and data consumers will only function with this value being zero or one. If the minimum number of occurrences is zero, this is equivalent, in SQL terms, to the attribute being nillable.- Returns:
-
getMaximumOccurrences
int getMaximumOccurrences()Returns the maximum number of occurrences of this attribute on a given feature.The vast majority of data sources and data consumers will only function with this value being one. A value ofInteger.MAX_VALUEindicates that the maximum number of occurrences is unbounded.- Returns:
-
isPrimaryKey
boolean isPrimaryKey()Returnstrueif this attribute forms all or part of the unique identifying value for the feature it is contained by. The primary key attributes uniquely identify this feature from other features of the same type. This is different from the Feature.getReference(), which must uniquely identify theFeatureamong all feature types.- Returns:
-
allowNull
boolean allowNull()Indicates whether this attribute accepts null values.- Returns:
- true if this attribute can be null, false if not.
-
getEvaluator
org.gvsig.tools.evaluator.Evaluator getEvaluator()Returns an evaluator that will be used to calculate the value of this attribute- Returns:
-
getSRS
org.gvsig.crs.projection.lib.Projection getSRS()If this attribute is aGeometry, this method returns its Spatial Reference System.- Returns:
- the SRS if this attribute is a
Geometry, otherwise this method returns null.
-
getGeometryType
int getGeometryType()If this attribute is aGeometry, this method returns the specific geometry type, as defined inGeometry.TYPES.- Returns:
- One of
Geometry.TYPES
-
getGeometrySubType
int getGeometrySubType()If this attribute is aGeometry, this method returns the specific geometry subtype, as defined inGeometry.SUBTYPES.- Returns:
- One of
Geometry.SUBTYPES
-
getGeomType
org.gvsig.fmap.geom.type.GeometryType getGeomType()Returns theGeometryTypeof the attribute if it is a geometry.- Returns:
- the geometry type
-
getDateFormat
DateFormat getDateFormat()If this attribute is of type Date, then this method returns the date format set by the data store.- Returns:
- a date format
-
getDefaultValueCoerced
Object getDefaultValueCoerced()Return the default value coerced to the data type of attribute. Return null if can't coerce.- Returns:
- default value or null.
-
getIndex
int getIndex()Returns this attribute relative position within theFeature.- Returns:
- an index
-
getAdditionalInfo
Returns additional information of the attribute- Parameters:
infoName-- Returns:
- info
-
isAutomatic
boolean isAutomatic()Returns if value is created automatically by the source- Returns:
-
isTime
boolean isTime()Gets if the attribute is a temporal attribute.- Returns:
trueif is a temporal attribute
-
getInterval
org.gvsig.timesupport.Interval getInterval() -
isIndexed
boolean isIndexed()Return true if the attribute has and index in the table.- Returns:
- true if indexed.
-
allowIndexDuplicateds
boolean allowIndexDuplicateds() -
isIndexAscending
boolean isIndexAscending() -
isForeingKey
boolean isForeingKey() -
getForeingKey
ForeingKey getForeingKey() -
getFeatureAttributeGetter
FeatureAttributeGetter getFeatureAttributeGetter()Gets if the attribute has aFeatureAttributeGetter.- Returns:
- a FeatureAttributeGetter or null.
-
setFeatureAttributeGetter
Sets theFeatureAttributeGetterthat is used to update the presentation of a field.- Parameters:
featureAttributeGetter- theFeatureAttributeGetterto set.
-
getFeatureAttributeEmulator
FeatureAttributeEmulator getFeatureAttributeEmulator()Gets the attribute emulator associattedFeatureAttributeEmulatorto this attribute.- Returns:
- a FeatureAttributeEmulator or null.
-
isComputed
boolean isComputed()Return true if the attribute has an evaluator o an emulator.- Returns:
-
getStore
FeatureStore getStore()Return the store associated to this attribute descriptor.- Returns:
- the FeatureStore of the attribute descriptor.
-
getFeatureType
FeatureType getFeatureType() -
getRequiredFieldNames
String[] getRequiredFieldNames() -
recentUsed
void recentUsed() -
getLocalizedShortLabel
String getLocalizedShortLabel()- Specified by:
getLocalizedShortLabelin interfaceorg.gvsig.tools.dynobject.DynField_LabelAttribute
-
getLocalizedLabel
String getLocalizedLabel()- Specified by:
getLocalizedLabelin interfaceorg.gvsig.tools.dynobject.DynField_LabelAttribute
-
getLabelOfValue
-
hasOnlyMetadataChanges
-
hasLabel
boolean hasLabel() -
hasShortLabel
boolean hasShortLabel() -
hasDescription
boolean hasDescription() -
get
Retrieve the value of the attribute "name".- Parameters:
name-- Returns:
-
hasConstantAvailableValues
boolean hasConstantAvailableValues() -
isAvoidCachingAvailableValues
boolean isAvoidCachingAvailableValues() -
getAvailableValuesExpression
org.gvsig.expressionevaluator.Expression getAvailableValuesExpression() -
setAvailableValuesExpression
-
setAvailableValuesExpression
FeatureAttributeDescriptor setAvailableValuesExpression(org.gvsig.expressionevaluator.Expression expression) -
isInAvailableValues
-
hasAvailableValues
boolean hasAvailableValues() -
getAvailableValuesFilter
org.gvsig.expressionevaluator.Expression getAvailableValuesFilter() -
getDefaultFormat
String getDefaultFormat() -
format
-