public final class AssociationRoleBuilder extends PropertyTypeBuilder
FeatureType
to be built by an FeatureTypeBuilder
to another
FeatureType
. A different instance of AssociationRoleBuilder
exists for each feature association
to describe. Those instances are created preferably by FeatureTypeBuilder.addAssociation(FeatureType)
,
or in case of cyclic reference by FeatureTypeBuilder.addAssociation(GenericName)
.DefaultAssociationRole
,
FeatureTypeBuilder.addAssociation(DefaultFeatureType)
,
FeatureTypeBuilder.addAssociation(GenericName)
Defined in the sis-feature
module
Modifier and Type | Method and Description |
---|---|
DefaultAssociationRole |
build()
Builds the association role from the information specified to this builder.
|
AssociationRoleBuilder |
setDefinition(CharSequence definition)
Sets a concise definition of the element.
|
AssociationRoleBuilder |
setDeprecated(boolean deprecated)
Sets whether the type is deprecated.
|
AssociationRoleBuilder |
setDescription(CharSequence description)
Sets optional information beyond that required for concise definition of the element.
|
AssociationRoleBuilder |
setDesignation(CharSequence designation)
Sets a natural language designator for the element.
|
AssociationRoleBuilder |
setMaximumOccurs(int occurs)
Sets the maximum number of associations.
|
AssociationRoleBuilder |
setMinimumOccurs(int occurs)
Sets the minimum number of associations.
|
AssociationRoleBuilder |
setName(CharSequence... components)
Sets the
FeatureAssociationRole name as a string in the given scope. |
AssociationRoleBuilder |
setName(CharSequence localPart)
Sets the
FeatureAssociationRole name as a simple string (local name). |
AssociationRoleBuilder |
setName(GenericName name)
Sets the
FeatureAssociationRole name as a generic name. |
getMaximumOccurs, getMinimumOccurs, remove
getDefinition, getDescription, getDesignation, getLocale, getName, isDeprecated, toString
public AssociationRoleBuilder setName(GenericName name)
FeatureAssociationRole
name as a generic name.
If another name was defined before this method call, that previous value will be discarded.setName
in class TypeBuilder
name
- the generic name (can not be null
).this
for allowing method calls chaining.TypeBuilder.getName()
,
TypeBuilder.setName(CharSequence)
,
AbstractIdentifiedType.NAME_KEY
public AssociationRoleBuilder setName(CharSequence localPart)
FeatureAssociationRole
name as a simple string (local name).
The namespace will be the value specified by the last call to 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 TypeBuilder
localPart
- 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 AssociationRoleBuilder setName(CharSequence... components)
FeatureAssociationRole
name as a string in the given scope.
The components
array must contain at least one element.
The last component (the tip) will be sufficient
in many cases for calls to the AbstractFeature.getProperty(String)
method.
The other elements before the last one are optional and can be used for resolving ambiguity.
They will be visible as the name path.
setName("A", "B", "C")
will create a "A:B:C" name.
An association built with this name can be obtained from a feature by a call to feature.getProperty("C")
if there is no ambiguity, or otherwise by a call to feature.getProperty("B:C")
(if non-ambiguous) or
feature.getProperty("A:B:C")
.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 TypeBuilder
components
- 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 AssociationRoleBuilder setMinimumOccurs(int occurs)
setMinimumOccurs
in class PropertyTypeBuilder
occurs
- the new minimum number of associations.this
for allowing method calls chaining.PropertyTypeBuilder.getMinimumOccurs()
public AssociationRoleBuilder setMaximumOccurs(int occurs)
setMaximumOccurs
in class PropertyTypeBuilder
occurs
- the new maximum number of associations.this
for allowing method calls chaining.PropertyTypeBuilder.getMaximumOccurs()
public AssociationRoleBuilder setDefinition(CharSequence definition)
setDefinition
in class TypeBuilder
definition
- a concise definition of the element, or null
if none.this
for allowing method calls chaining.TypeBuilder.getDefinition()
,
AbstractIdentifiedType.DEFINITION_KEY
public AssociationRoleBuilder setDesignation(CharSequence designation)
setDesignation
in class TypeBuilder
designation
- a natural language designator for the element, or null
if none.this
for allowing method calls chaining.TypeBuilder.getDesignation()
,
AbstractIdentifiedType.DESIGNATION_KEY
public AssociationRoleBuilder setDescription(CharSequence description)
setDescription
in class TypeBuilder
description
- information beyond that required for concise definition of the element, or null
if none.this
for allowing method calls chaining.TypeBuilder.getDescription()
,
AbstractIdentifiedType.DESCRIPTION_KEY
public AssociationRoleBuilder setDeprecated(boolean deprecated)
setDeprecated
in class TypeBuilder
deprecated
- whether this type is deprecated.this
for allowing method calls chaining.TypeBuilder.isDeprecated()
,
AbstractIdentifiedType.DEPRECATED_KEY
public DefaultAssociationRole build()
FeatureAssociationRole
instance is returned.
org.opengis.feature.FeatureAssociationRole
interface. This change is pending GeoAPI revision.build
in class PropertyTypeBuilder
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.