@Immutable public abstract class BasicProperty extends Object implements Property
Property
implementation.Property.ValueTypeTransformer<T>
Constructor and Description |
---|
BasicProperty(Name name) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Property that) |
boolean |
equals(Object obj) |
Name |
getName()
Get the name of the property.
|
String |
getString()
Get the string form of the object.
|
String |
getString(NamespaceRegistry namespaceRegistry)
Get the string form of the object, using the supplied namespace registry to convert any namespace URIs to prefixes.
|
String |
getString(NamespaceRegistry namespaceRegistry,
TextEncoder encoder)
Get the encoded string form of the object, using the supplied namespace registry to convert the any namespace URIs to
prefixes.
|
String |
getString(NamespaceRegistry namespaceRegistry,
TextEncoder encoder,
TextEncoder delimiterEncoder)
Get the encoded string form of the object, using the supplied namespace registry to convert the names' namespace URIs to
prefixes and the supplied encoder to encode characters, and using the second delimiter to encode (or convert) the delimiter
used between the namespace prefix and the local part of any names.
|
String |
getString(TextEncoder encoder)
Get the encoded string form of the object, using the supplied encoder to encode characters.
|
Iterator<?> |
getValues()
Obtain the property's values in their natural form.
|
Object[] |
getValuesAsArray()
Obtain the property's values as an array of objects in their natural form.
|
<T> T[] |
getValuesAsArray(Property.ValueTypeTransformer<T> valueTypeTransformer,
Class<T> type)
Convert the values of this property to the given type, using the specified type transformer.
|
<T> T[] |
getValuesAsArray(ValueFactory<T> valueFactory)
Convert the values of this property to whatever type the given value factory is used to create.
|
int |
hashCode() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getFirstValue, getValue, isBinary, isEmpty, isMultiple, isReference, isSimpleReference, isSingle, size
forEach, iterator, spliterator
public BasicProperty(Name name)
name
- public Name getName()
Property
public Iterator<?> getValues()
Property
iterator()
.
A valid iterator is returned if the property has single valued
or multi-valued
.
The resulting iterator is immutable, and all property values are immutable.
getValues
in interface Property
Property.getFirstValue()
,
Iterable.iterator()
,
Property.getValuesAsArray()
,
ValueFactory.create(Iterator)
public Object[] getValuesAsArray()
Property
A valid array is return if the property has single valued
or multi-valued
, or a
null value is returned if the property is empty
.
The resulting array is a copy, guaranteeing immutability for the property.
getValuesAsArray
in interface Property
Property.getFirstValue()
,
Iterable.iterator()
,
Property.getValues()
,
ValueFactory.create(Object[])
public int compareTo(Property that)
compareTo
in interface Comparable<Property>
public String getString()
Readable
default encoder
is used to encode characters.getString
in interface Readable
Readable.getString(TextEncoder)
public String getString(TextEncoder encoder)
Readable
getString
in interface Readable
encoder
- the encoder to use, or null if the default encoder
should be usedReadable.getString()
public String getString(NamespaceRegistry namespaceRegistry)
Readable
default encoder
is used to encode characters.getString
in interface Readable
namespaceRegistry
- the namespace registry that should be used to obtain the prefix for any namespace URIsReadable.getString(NamespaceRegistry,TextEncoder)
public String getString(NamespaceRegistry namespaceRegistry, TextEncoder encoder)
Readable
getString
in interface Readable
namespaceRegistry
- the namespace registry that should be used to obtain the prefix for the namespace URIsencoder
- the encoder to use, or null if the default encoder
should be usedReadable.getString(NamespaceRegistry)
public String getString(NamespaceRegistry namespaceRegistry, TextEncoder encoder, TextEncoder delimiterEncoder)
Readable
getString
in interface Readable
namespaceRegistry
- the namespace registry that should be used to obtain the prefix for the namespace URIs in the
segment names
encoder
- the encoder to use for encoding the local part and namespace prefix of any names, or null if the
default encoder
should be useddelimiterEncoder
- the encoder to use for encoding the delimiter between the local part and namespace prefix of any
names, or null if the standard delimiter should be usedReadable.getString(NamespaceRegistry)
,
Readable.getString(NamespaceRegistry, TextEncoder)
public <T> T[] getValuesAsArray(ValueFactory<T> valueFactory) throws ValueFormatException
Property
getValuesAsArray
in interface Property
valueFactory
- a AbstractValueFactory
representing the factory which will
be used to attempt the conversion of each value.ValueFormatException
- if the conversion cannot be performed for any value in the array of values.public <T> T[] getValuesAsArray(Property.ValueTypeTransformer<T> valueTypeTransformer, Class<T> type) throws ValueFormatException
Property
getValuesAsArray
in interface Property
valueTypeTransformer
- a Property.ValueTypeTransformer
representing the transformer which will
be used to attempt the conversion of each value.type
- a Class
indicating the type to which the transformation is performed; required because of type erasure.ValueFormatException
- if the conversion cannot be performed for any value in the array of values.Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.