public class AttributeBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected static ComplexType |
ANYTYPE_TYPE |
Constructor and Description |
---|
AttributeBuilder(FeatureFactory attributeFactory) |
Modifier and Type | Method and Description |
---|---|
Attribute |
add(Object value,
Name name)
Adds an attribute to the complex attribute being built.
|
Attribute |
add(Object value,
String name)
Adds an attribute to the complex attribute being built.
|
Attribute |
add(Object value,
String name,
String namespaceURI)
Adds an attribute to the complex attribute being built.
|
Attribute |
add(String id,
Object value,
Name name)
Adds an attribute to the complex attribute being built.
|
Attribute |
add(String id,
Object value,
String name)
Adds an attribute to the complex attribute being built.
|
Attribute |
add(String id,
Object value,
String name,
String namespaceURI)
Adds an attribute to the complex attribute being built.
|
Attribute |
addAnyTypeValue(Object value,
AttributeType type,
AttributeDescriptor descriptor,
String id)
Special case for any type.
|
Attribute |
addComplexAnyTypeAttribute(Object value,
AttributeDescriptor descriptor,
String id)
Create a complex attribute for XS.AnyType, since it's defined as a simple type.
|
void |
associate(Attribute value,
Name name)
Adds an association to the complex attribute being built.
|
void |
associate(Attribute value,
String name)
Adds an association to the complex attribute being built.
|
void |
associate(Attribute attribute,
String name,
String namespaceURI)
Adds an association to the complex attribute being built.
|
protected AssociationDescriptor |
associationDescriptor(Name name) |
protected AttributeDescriptor |
attributeDescriptor(Name name) |
Attribute |
build()
Builds the attribute.
|
Attribute |
build(String id)
Builds the attribute.
|
Attribute |
buildSimple(String id,
Object value) |
protected Attribute |
create(Object value,
AttributeType type,
AttributeDescriptor descriptor,
String id)
Factors out attribute creation code, needs to be called with either one of type or descriptor
null.
|
ComplexAttribute |
createComplexAttribute(Object value,
ComplexType type,
AttributeDescriptor descriptor,
String id)
Create complex attribute
|
CoordinateReferenceSystem |
getCRS() |
CoordinateReferenceSystem |
getCRS(Object geom) |
Object |
getDefaultGeometry() |
AttributeDescriptor |
getDescriptor() |
FeatureFactory |
getFeatureFactory()
Returns the underlying attribute factory.
|
String |
getNamespaceURI()
This namespace will be used when constructing attribute names.
|
protected List |
getProperties()
Convenience accessor for properties list which does the null check.
|
AttributeType |
getType() |
void |
init()
Initializes the builder to its initial state, the same state it is in directly after being
instantiated.
|
void |
init(Attribute attribute)
Initializes the state of the builder based on a previously built attribute.
|
protected List |
properties()
Convenience accessor for properties list which does the null check.
|
void |
setCRS(CoordinateReferenceSystem crs)
Sets the coordinate reference system of the built feature.
|
void |
setDefaultGeometry(Object defaultGeometry)
Sets the default geometry of the feature.
|
void |
setDescriptor(AttributeDescriptor descriptor)
Sets the descriptor of the attribute being built.
|
void |
setFeatureFactory(FeatureFactory attributeFactory)
Sets the underlying attribute factory.
|
void |
setNamespaceURI(String namespace)
This namespace will be used when constructing attribute names.
|
void |
setType(AttributeType type)
Sets the type of the attribute being built.
|
protected static final ComplexType ANYTYPE_TYPE
public AttributeBuilder(FeatureFactory attributeFactory)
public FeatureFactory getFeatureFactory()
public void setFeatureFactory(FeatureFactory attributeFactory)
public void init()
public void init(Attribute attribute)
This method is useful when copying another attribute.
public void setNamespaceURI(String namespace)
public String getNamespaceURI()
public void setType(AttributeType type)
When building a complex attribute, this type is used a reference to obtain the types of contained attributes.
public void setDescriptor(AttributeDescriptor descriptor)
When building a complex attribute, this type is used a reference to obtain the types of contained attributes.
public AttributeType getType()
public void setCRS(CoordinateReferenceSystem crs)
public CoordinateReferenceSystem getCRS(Object geom)
public void setDefaultGeometry(Object defaultGeometry)
public Object getDefaultGeometry()
public Attribute add(Object value, String name)
This method uses the result of getNamespaceURI()
to build a qualified attribute
name.
This method uses the type supplied in setType(AttributeType)
in order to
determine the attribute type.
name
- The name of the attribute.value
- The value of the attribute.public void associate(Attribute value, String name)
This method uses the result of getNamespaceURI()
to build a qualified attribute
name.
This method uses the type supplied in setType(AttributeType)
in order to
determine the association type.
value
- The value of the association, an attribute.name
- The name of the association.public Attribute add(Object value, String name, String namespaceURI)
This method uses the type supplied in setType(AttributeType)
in order to
determine the attribute type.
value
- The value of the attribute.name
- The name of the attribute.namespaceURI
- The namespace of the attribute.public void associate(Attribute attribute, String name, String namespaceURI)
This method uses the type supplied in setType(AttributeType)
in order to
determine the association type.
value
- The value of the association, an attribute.name
- The name of the association.namespaceURI
- The namespace of the associationpublic Attribute add(Object value, Name name)
This method uses the type supplied in setType(AttributeType)
in order to
determine the attribute type.
name
- The name of the attribute.value
- The value of the attribute.public void associate(Attribute value, Name name)
This method uses the type supplied in setType(AttributeType)
in order to
determine the association type.
value
- The value of the association, an attribute.name
- The name of the association.namespaceURI
- The namespace of the associationpublic Attribute add(String id, Object value, String name)
The result of getNamespaceURI()
to build a qualified attribute name.
This method uses the type supplied in setType(AttributeType)
in order to
determine the attribute type.
id
- The id of the attribute.name
- The name of the attribute.value
- The value of the attribute.public Attribute add(String id, Object value, String name, String namespaceURI)
This method uses the type supplied in setType(AttributeType)
in order to
determine the attribute type.
id
- The id of the attribute.value
- The value of the attribute.name
- The name of the attribute.namespaceURI
- The namespace of the attribute.public Attribute add(String id, Object value, Name name)
This method uses the type supplied in setType(AttributeType)
in order to
determine the attribute type.
id
- The id of the attribute.name
- The name of the attribute.value
- The value of the attribute.protected List properties()
protected AssociationDescriptor associationDescriptor(Name name)
protected AttributeDescriptor attributeDescriptor(Name name)
protected Attribute create(Object value, AttributeType type, AttributeDescriptor descriptor, String id)
public ComplexAttribute createComplexAttribute(Object value, ComplexType type, AttributeDescriptor descriptor, String id)
value
- type
- descriptor
- id
- public Attribute build()
The class of the attribute built is determined from its type set with setType(AttributeType)
.
public Attribute build(String id)
The class of the attribute built is determined from its type set with setType(AttributeType)
.
id
- The id of the attribute, or null.public Attribute addAnyTypeValue(Object value, AttributeType type, AttributeDescriptor descriptor, String id)
value
- the value to be settype
- the type of the valuedescriptor
- the attribute descriptor of anyType typeid
- public Attribute addComplexAnyTypeAttribute(Object value, AttributeDescriptor descriptor, String id)
value
- descriptor
- id
- public AttributeDescriptor getDescriptor()
public CoordinateReferenceSystem getCRS()
protected List getProperties()
Copyright © 1996–2019 Geotools. All rights reserved.