org.modeshape.jcr.value

## Class ValueTypeSystem

- java.lang.Object
- - org.modeshape.jcr.query.model.TypeSystem
  - - org.modeshape.jcr.value.ValueTypeSystem

-     public final class ValueTypeSystem
      extends TypeSystem

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `ValueTypeSystem.Factory<T>`
    `protected static class` | `ValueTypeSystem.NodeKeyTypeFactory`

    - ### Nested classes/interfaces inherited from class org.modeshape.jcr.query.model.TypeSystem

      `TypeSystem.SerializableComparator<T>, TypeSystem.TypeFactory<T>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ValueFactory<String>` | `stringValueFactory`
    `protected ValueFactories` | `valueFactories`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValueTypeSystem(ValueFactories valueFactories)` Create a type system using the supplied value factories.

  - ### Method Summary

    Methods
    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.

    - ### Methods inherited from class org.modeshape.jcr.query.model.TypeSystem

      `with, withComparator, withOppositeComparator`

    - ### 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 class: `TypeSystem`
      Get the string representation of the supplied value, using the most appropriate factory given the value.
      Specified by:
        `asString` in class `TypeSystem`
      Parameters:
        `value` - the value
      Returns:
        the string representation; never null

    - #### getBooleanFactory

          public TypeSystem.TypeFactory<Boolean> getBooleanFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for boolean types.
      Specified by:
        `getBooleanFactory` in class `TypeSystem`
      Returns:
        the boolean factory; never null

    - #### getStringFactory

          public TypeSystem.TypeFactory<String> getStringFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for string types.
      Specified by:
        `getStringFactory` in class `TypeSystem`
      Returns:
        the string factory; never null

    - #### getDateTimeFactory

          public TypeSystem.TypeFactory<?> getDateTimeFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for date-time objects.
      Specified by:
        `getDateTimeFactory` in class `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 class: `TypeSystem`
      Get the name of the type that is used by default.
      Specified by:
        `getDefaultType` in class `TypeSystem`
      Returns:
        the default type name; never null

    - #### getDefaultComparator

          public Comparator<Object> getDefaultComparator()

      Description copied from class: `TypeSystem`
      Get the comparator that should be used by default.
      Specified by:
        `getDefaultComparator` in class `TypeSystem`
      Returns:
        the default comparator; never null

    - #### getDoubleFactory

          public TypeSystem.TypeFactory<Double> getDoubleFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for double types.
      Specified by:
        `getDoubleFactory` in class `TypeSystem`
      Returns:
        the double factory; never null

    - #### getDecimalFactory

          public TypeSystem.TypeFactory<BigDecimal> getDecimalFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for decimal types.
      Specified by:
        `getDecimalFactory` in class `TypeSystem`
      Returns:
        the decimal factory; never null

    - #### getLongFactory

          public TypeSystem.TypeFactory<Long> getLongFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for long types.
      Specified by:
        `getLongFactory` in class `TypeSystem`
      Returns:
        the long factory; never null

    - #### getPathFactory

          public TypeSystem.TypeFactory<Path> getPathFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for path objects.
      Specified by:
        `getPathFactory` in class `TypeSystem`
      Returns:
        the path factory, or null if this type system doesn't support path objects

    - #### getNameFactory

          public TypeSystem.TypeFactory<Name> getNameFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for name objects.
      Specified by:
        `getNameFactory` in class `TypeSystem`
      Returns:
        the name factory, or null if this type system doesn't support path objects

    - #### getReferenceFactory

          public TypeSystem.TypeFactory<Reference> getReferenceFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for references objects.
      Specified by:
        `getReferenceFactory` in class `TypeSystem`
      Returns:
        the reference factory, or null if this type system doesn't support reference objects

    - #### getBinaryFactory

          public TypeSystem.TypeFactory<BinaryValue> getBinaryFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for binary objects.
      Specified by:
        `getBinaryFactory` in class `TypeSystem`
      Returns:
        the binary factory, or null if this type system doesn't support binary objects

    - #### getNodeKeyFactory

          public TypeSystem.TypeFactory<NodeKey> getNodeKeyFactory()

      Description copied from class: `TypeSystem`
      Get the type factory for node key objects.
      Specified by:
        `getNodeKeyFactory` in class `TypeSystem`
      Returns:
        the node key factory, or null if this type system doesn't support node key objects

    - #### getTypeFactory

          public TypeSystem.TypeFactory<?> getTypeFactory(String typeName)

      Description copied from class: `TypeSystem`
      Get the type factory given the name of the type.
      Specified by:
        `getTypeFactory` in class `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 class: `TypeSystem`
      Get the type factory for the type denoted by the supplied prototype value.
      Specified by:
        `getTypeFactory` in class `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 class: `TypeSystem`
      Get the names of the supported types.
      Specified by:
        `getTypeNames` in class `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 class: `TypeSystem`
      Get the type that is compatible with both of the supplied types.
      Specified by:
        `getCompatibleType` in class `TypeSystem`
      Parameters:
        `type1` - the first type; may be null
        `type2` - the second type; may be null
      Returns:
        the compatible type; never null

    - #### getCompatibleType

          public TypeSystem.TypeFactory<?> getCompatibleType(TypeSystem.TypeFactory<?> type1,
                                                    TypeSystem.TypeFactory<?> type2)

      Description copied from class: `TypeSystem`
      Get the type that is compatible with both of the supplied types.
      Specified by:
        `getCompatibleType` in class `TypeSystem`
      Parameters:
        `type1` - the first type; may be null
        `type2` - the second type; may be null
      Returns:
        the compatible type; never null

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