V - the class of characteristic values.public final class CharacteristicTypeBuilder<V> extends TypeBuilder
AttributeType will will be built by a FeatureTypeBuilder.
Characteristics can describe additional information useful for interpreting an attribute value, like
the units of measurement and uncertainties of a numerical value, or the coordinate reference system
(CRS) of a geometry.
In many cases, all instances of the same AttributeType have the same characteristics.
For example all values of the "temperature" attribute typically have the same units of measurement.
Such common value can be specified as the characteristic default value.
AttributeTypeBuilder.addCharacteristic(Class)Defined in the sis-feature module
| Modifier and Type | Method and Description |
|---|---|
DefaultAttributeType<V> |
build()
Builds the characteristic type from the information specified to this builder.
|
V |
getDefaultValue()
Returns the default value for the characteristic, or
null if none. |
Class<V> |
getValueClass()
Returns the class of characteristic values.
|
void |
remove()
Removes this characteristics from the
AttributeTypeBuilder. |
CharacteristicTypeBuilder<V> |
setDefaultValue(V value)
Sets the default value for the characteristic.
|
CharacteristicTypeBuilder<V> |
setDefinition(CharSequence definition)
Sets a concise definition of the element.
|
CharacteristicTypeBuilder<V> |
setDeprecated(boolean deprecated)
Sets whether the type is deprecated.
|
CharacteristicTypeBuilder<V> |
setDescription(CharSequence description)
Sets optional information beyond that required for concise definition of the element.
|
CharacteristicTypeBuilder<V> |
setDesignation(CharSequence designation)
Sets a natural language designator for the element.
|
CharacteristicTypeBuilder<V> |
setName(CharSequence... components)
Sets the characteristic name as a string in the given scope.
|
CharacteristicTypeBuilder<V> |
setName(CharSequence localPart)
Sets the characteristic name as a simple string (local name).
|
CharacteristicTypeBuilder<V> |
setName(GenericName name)
Sets the characteristic name as a generic name.
|
<N> CharacteristicTypeBuilder<N> |
setValueClass(Class<N> type)
Sets the class of characteristic values.
|
getDefinition, getDescription, getDesignation, getLocale, getName, isDeprecated, toStringpublic CharacteristicTypeBuilder<V> setName(GenericName name)
setName in class TypeBuildername - the generic name (can not be null).this for allowing method calls chaining.TypeBuilder.getName(),
TypeBuilder.setName(CharSequence),
AbstractIdentifiedType.NAME_KEYpublic CharacteristicTypeBuilder<V> setName(CharSequence localPart)
FeatureTypeBuilder.setNameSpace(CharSequence),
but that namespace will not be visible in the string representation unless the fully qualified name is requested.
This convenience method creates a LocalName instance from
the given CharSequence, then delegates to setName(GenericName).
setName in class TypeBuilderlocalPart - the local part of the generic name as a String or InternationalString.this for allowing method calls chaining.TypeBuilder.getName(),
TypeBuilder.setName(CharSequence...),
FeatureTypeBuilder.getNameSpace()public CharacteristicTypeBuilder<V> setName(CharSequence... components)
components array must contain at least one element.
The last component (the tip) will be sufficient
in many cases for getting values from the characteristics map. The other elements before the last one are optional and can be used for resolving ambiguity.
They will be visible as the name path.
In addition to the path specified by the components array, the name may also contain
a namespace specified by the last call to FeatureTypeBuilder.setNameSpace(CharSequence).
But contrarily to the specified components, the namespace will not be visible in the name
string representation unless the
fully qualified name
is requested.
This convenience method creates a LocalName or ScopedName
instance depending on whether the names array contains exactly 1 element or more than 1 element, then
delegates to setName(GenericName).
setName in class TypeBuildercomponents - the name components as an array of String or InternationalString instances.this for allowing method calls chaining.TypeBuilder.getName(),
TypeBuilder.setName(CharSequence),
FeatureTypeBuilder.getNameSpace()public Class<V> getValueClass()
setValueClass(Class)public <N> CharacteristicTypeBuilder<N> setValueClass(Class<N> type) throws UnconvertibleObjectException
this builder after this method call, since the returned builder may be a new instance.N - the compile-time value of the type argument.type - the new class of characteristic values.UnconvertibleObjectException - if the default value
can not be converted to the given <N> class.getValueClass()public V getDefaultValue()
null if none.null if none.setDefaultValue(Object)public CharacteristicTypeBuilder<V> setDefaultValue(V value)
value - characteristic default value, or null if none.this for allowing method calls chaining.getDefaultValue()public CharacteristicTypeBuilder<V> setDefinition(CharSequence definition)
setDefinition in class TypeBuilderdefinition - a concise definition of the element, or null if none.this for allowing method calls chaining.TypeBuilder.getDefinition(),
AbstractIdentifiedType.DEFINITION_KEYpublic CharacteristicTypeBuilder<V> setDesignation(CharSequence designation)
setDesignation in class TypeBuilderdesignation - a natural language designator for the element, or null if none.this for allowing method calls chaining.TypeBuilder.getDesignation(),
AbstractIdentifiedType.DESIGNATION_KEYpublic CharacteristicTypeBuilder<V> setDescription(CharSequence description)
setDescription in class TypeBuilderdescription - information beyond that required for concise definition of the element, or null if none.this for allowing method calls chaining.TypeBuilder.getDescription(),
AbstractIdentifiedType.DESCRIPTION_KEYpublic CharacteristicTypeBuilder<V> setDeprecated(boolean deprecated)
setDeprecated in class TypeBuilderdeprecated - whether this type is deprecated.this for allowing method calls chaining.TypeBuilder.isDeprecated(),
AbstractIdentifiedType.DEPRECATED_KEYpublic DefaultAttributeType<V> build()
AttributeType instance is returned.
org.opengis.feature.AttributeType interface. This change is pending GeoAPI revision.build in class TypeBuilderpublic void remove()
AttributeTypeBuilder.
After this method has been invoked, this CharacteristicTypeBuilder instance
is no longer in the list returned by AttributeTypeBuilder.characteristics()
and attempts to invoke any setter method on this will cause an
IllegalStateException to be thrown.Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.