ModeShape Distribution 3.0.0.Beta4

org.modeshape.jcr.value
Class ValueTypeSystem

java.lang.Object
  extended by org.modeshape.jcr.value.ValueTypeSystem
All Implemented Interfaces:
TypeSystem

public class ValueTypeSystem
extends Object
implements TypeSystem


Nested Class Summary
protected  class ValueTypeSystem.Factory<T>
           
 
Nested classes/interfaces inherited from interface org.modeshape.jcr.query.model.TypeSystem
TypeSystem.TypeFactory<T>
 
Field Summary
protected  ValueFactory<String> stringValueFactory
           
protected  ValueFactories valueFactories
           
 
Constructor Summary
ValueTypeSystem(ValueFactories valueFactories)
          Create a type system using the supplied value factories.
 
Method Summary
 String asString(Object value)
          Get the string representation of the supplied value, using the most appropriate factory given the value.
 TypeSystem.TypeFactory<?> 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<?> 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<?> getPathFactory()
          Get the type factory for path objects.
 TypeSystem.TypeFactory<?> 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valueFactories

protected final ValueFactories valueFactories

stringValueFactory

protected final ValueFactory<String> stringValueFactory
Constructor Detail

ValueTypeSystem

public ValueTypeSystem(ValueFactories valueFactories)
Create a type system using the supplied value factories.

Parameters:
valueFactories - the value factories;
Throws:
IllegalArgumentException - if the value factories are null
Method Detail

asString

public String asString(Object value)
Description copied from interface: TypeSystem
Get the string representation of the supplied value, using the most appropriate factory given the value.

Specified by:
asString in interface TypeSystem
Parameters:
value - the value
Returns:
the string representation; never null

getBooleanFactory

public TypeSystem.TypeFactory<Boolean> getBooleanFactory()
Description copied from interface: TypeSystem
Get the type factory for boolean types.

Specified by:
getBooleanFactory in interface TypeSystem
Returns:
the boolean factory; never null

getStringFactory

public TypeSystem.TypeFactory<String> getStringFactory()
Description copied from interface: TypeSystem
Get the type factory for string types.

Specified by:
getStringFactory in interface TypeSystem
Returns:
the string factory; never null

getDateTimeFactory

public TypeSystem.TypeFactory<?> getDateTimeFactory()
Description copied from interface: TypeSystem
Get the type factory for date-time objects.

Specified by:
getDateTimeFactory in interface TypeSystem
Returns:
the date-time factory, or null if this type system doesn't support date-time objects

getDefaultType

public String getDefaultType()
Description copied from interface: TypeSystem
Get the name of the type that is used by default.

Specified by:
getDefaultType in interface TypeSystem
Returns:
the default type name; never null

getDefaultComparator

public Comparator<Object> getDefaultComparator()
Description copied from interface: TypeSystem
Get the comparator that should be used by default.

Specified by:
getDefaultComparator in interface TypeSystem
Returns:
the default comparator; never null

getDoubleFactory

public TypeSystem.TypeFactory<Double> getDoubleFactory()
Description copied from interface: TypeSystem
Get the type factory for double types.

Specified by:
getDoubleFactory in interface TypeSystem
Returns:
the double factory; never null

getDecimalFactory

public TypeSystem.TypeFactory<BigDecimal> getDecimalFactory()
Description copied from interface: TypeSystem
Get the type factory for decimal types.

Specified by:
getDecimalFactory in interface TypeSystem
Returns:
the decimal factory; never null

getLongFactory

public TypeSystem.TypeFactory<Long> getLongFactory()
Description copied from interface: TypeSystem
Get the type factory for long types.

Specified by:
getLongFactory in interface TypeSystem
Returns:
the long factory; never null

getPathFactory

public TypeSystem.TypeFactory<?> getPathFactory()
Description copied from interface: TypeSystem
Get the type factory for path objects.

Specified by:
getPathFactory in interface TypeSystem
Returns:
the path factory, or null if this type system doesn't support path objects

getReferenceFactory

public TypeSystem.TypeFactory<?> getReferenceFactory()
Description copied from interface: TypeSystem
Get the type factory for references objects.

Specified by:
getReferenceFactory in interface TypeSystem
Returns:
the reference factory, or null if this type system doesn't support reference objects

getBinaryFactory

public TypeSystem.TypeFactory<?> getBinaryFactory()
Description copied from interface: TypeSystem
Get the type factory for binary objects.

Specified by:
getBinaryFactory in interface TypeSystem
Returns:
the binary factory, or null if this type system doesn't support binary objects

getTypeFactory

public TypeSystem.TypeFactory<?> getTypeFactory(String typeName)
Description copied from interface: TypeSystem
Get the type factory given the name of the type.

Specified by:
getTypeFactory in interface TypeSystem
Parameters:
typeName - the name of the type
Returns:
the type factory, or null if there is no such type in this system

getTypeFactory

public TypeSystem.TypeFactory<?> getTypeFactory(Object prototype)
Description copied from interface: TypeSystem
Get the type factory for the type denoted by the supplied prototype value.

Specified by:
getTypeFactory in interface TypeSystem
Parameters:
prototype - the value whose type is to be identified
Returns:
the type factory, or null if there is no such type in this system

getTypeNames

public Set<String> getTypeNames()
Description copied from interface: TypeSystem
Get the names of the supported types.

Specified by:
getTypeNames in interface TypeSystem
Returns:
the immutable set of the uppercase names of the types; never null

getCompatibleType

public String getCompatibleType(String type1,
                                String type2)
Description copied from interface: TypeSystem
Get the type that is compatible with both of the supplied types.

Specified by:
getCompatibleType in interface TypeSystem
Parameters:
type1 - the first type; may be null
type2 - the second type; may be null
Returns:
the compatible type; never null

ModeShape Distribution 3.0.0.Beta4

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.