public final class ValueTypeSystem extends TypeSystem
Modifier and Type | Class and Description |
---|---|
protected class |
ValueTypeSystem.Factory<T> |
protected static class |
ValueTypeSystem.NodeKeyTypeFactory |
TypeSystem.SerializableComparator<T>, TypeSystem.TypeFactory<T>
Modifier and Type | Field and Description |
---|---|
protected ValueFactory<String> |
stringValueFactory |
protected ValueFactories |
valueFactories |
Constructor and Description |
---|
ValueTypeSystem(ValueFactories valueFactories)
Create a type system using the supplied value factories.
|
ValueTypeSystem(ValueFactories valueFactories,
Locale locale)
Create a type system using the supplied value factories and locale
|
Modifier and Type | Method and Description |
---|---|
String |
asString(Object value)
Get the string representation of the supplied value, using the most appropriate factory given the value.
|
TypeSystem.TypeFactory<BinaryValue> |
getBinaryFactory()
Get the type factory for binary objects.
|
TypeSystem.TypeFactory<Boolean> |
getBooleanFactory()
Get the type factory for boolean types.
|
String |
getCompatibleType(String type1,
String type2)
Get the type that is compatible with both of the supplied types.
|
TypeSystem.TypeFactory<?> |
getCompatibleType(TypeSystem.TypeFactory<?> type1,
TypeSystem.TypeFactory<?> type2)
Get the type that is compatible with both of the supplied types.
|
TypeSystem.TypeFactory<?> |
getDateTimeFactory()
Get the type factory for date-time objects.
|
TypeSystem.TypeFactory<BigDecimal> |
getDecimalFactory()
Get the type factory for decimal types.
|
Comparator<Object> |
getDefaultComparator()
Get the comparator that should be used by default.
|
String |
getDefaultType()
Get the name of the type that is used by default.
|
TypeSystem.TypeFactory<Double> |
getDoubleFactory()
Get the type factory for double types.
|
TypeSystem.TypeFactory<Long> |
getLongFactory()
Get the type factory for long types.
|
TypeSystem.TypeFactory<Name> |
getNameFactory()
Get the type factory for name objects.
|
TypeSystem.TypeFactory<NodeKey> |
getNodeKeyFactory()
Get the type factory for node key objects.
|
TypeSystem.TypeFactory<Path> |
getPathFactory()
Get the type factory for path objects.
|
TypeSystem.TypeFactory<Reference> |
getReferenceFactory()
Get the type factory for references objects.
|
TypeSystem.TypeFactory<String> |
getStringFactory()
Get the type factory for string types.
|
TypeSystem.TypeFactory<?> |
getTypeFactory(Object prototype)
Get the type factory for the type denoted by the supplied prototype value.
|
TypeSystem.TypeFactory<?> |
getTypeFactory(String typeName)
Get the type factory given the name of the type.
|
Set<String> |
getTypeNames()
Get the names of the supported types.
|
with, withComparator, withOppositeComparator
protected final ValueFactories valueFactories
protected final ValueFactory<String> stringValueFactory
public ValueTypeSystem(ValueFactories valueFactories)
valueFactories
- the value factories;IllegalArgumentException
- if the value factories are nullpublic ValueTypeSystem(ValueFactories valueFactories, Locale locale)
valueFactories
- the value factories;locale
- the locale, may not be nullIllegalArgumentException
- if the value factories are nullpublic String asString(Object value)
TypeSystem
asString
in class TypeSystem
value
- the valuepublic TypeSystem.TypeFactory<Boolean> getBooleanFactory()
TypeSystem
getBooleanFactory
in class TypeSystem
public TypeSystem.TypeFactory<String> getStringFactory()
TypeSystem
getStringFactory
in class TypeSystem
public TypeSystem.TypeFactory<?> getDateTimeFactory()
TypeSystem
getDateTimeFactory
in class TypeSystem
public String getDefaultType()
TypeSystem
getDefaultType
in class TypeSystem
public Comparator<Object> getDefaultComparator()
TypeSystem
getDefaultComparator
in class TypeSystem
public TypeSystem.TypeFactory<Double> getDoubleFactory()
TypeSystem
getDoubleFactory
in class TypeSystem
public TypeSystem.TypeFactory<BigDecimal> getDecimalFactory()
TypeSystem
getDecimalFactory
in class TypeSystem
public TypeSystem.TypeFactory<Long> getLongFactory()
TypeSystem
getLongFactory
in class TypeSystem
public TypeSystem.TypeFactory<Path> getPathFactory()
TypeSystem
getPathFactory
in class TypeSystem
public TypeSystem.TypeFactory<Name> getNameFactory()
TypeSystem
getNameFactory
in class TypeSystem
public TypeSystem.TypeFactory<Reference> getReferenceFactory()
TypeSystem
getReferenceFactory
in class TypeSystem
public TypeSystem.TypeFactory<BinaryValue> getBinaryFactory()
TypeSystem
getBinaryFactory
in class TypeSystem
public TypeSystem.TypeFactory<NodeKey> getNodeKeyFactory()
TypeSystem
getNodeKeyFactory
in class TypeSystem
public TypeSystem.TypeFactory<?> getTypeFactory(String typeName)
TypeSystem
getTypeFactory
in class TypeSystem
typeName
- the name of the typepublic TypeSystem.TypeFactory<?> getTypeFactory(Object prototype)
TypeSystem
getTypeFactory
in class TypeSystem
prototype
- the value whose type is to be identifiedpublic Set<String> getTypeNames()
TypeSystem
getTypeNames
in class TypeSystem
public String getCompatibleType(String type1, String type2)
TypeSystem
getCompatibleType
in class TypeSystem
type1
- the first type; may be nulltype2
- the second type; may be nullpublic TypeSystem.TypeFactory<?> getCompatibleType(TypeSystem.TypeFactory<?> type1, TypeSystem.TypeFactory<?> type2)
TypeSystem
getCompatibleType
in class TypeSystem
type1
- the first type; may be nulltype2
- the second type; may be nullCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.