org.modeshape.jcr.value

## Enum PropertyType

- java.lang.Object
- - java.lang.Enum<PropertyType>
  - - org.modeshape.jcr.value.PropertyType

- All Implemented Interfaces:
    Serializable, Comparable<PropertyType>

      @Immutable
      public enum PropertyType
      extends Enum<PropertyType>

  The data types for property values.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `PropertyType.ClassBasedTypeChecker`
    `protected static class` | `PropertyType.DateCanonicalizer`
    `protected static class` | `PropertyType.DoubleCanonicalizer`
    `protected static class` | `PropertyType.LongCanonicalizer`
    `protected static class` | `PropertyType.ObjectCanonicalizer`

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `BINARY`
    `BOOLEAN`
    `DATE`
    `DECIMAL`
    `DOUBLE`
    `LONG`
    `NAME`
    `OBJECT`
    `PATH`
    `REFERENCE`
    `SIMPLEREFERENCE`
    `STRING`
    `URI`
    `WEAKREFERENCE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static PropertyType` | `discoverType(Class<?> clazz)` Discover the most appropriate `PropertyType` whose values can be assigned to variables or parameters of the supplied type.
    `static PropertyType` | `discoverType(Object value)`
    `Object` | `getCanonicalValue(Object value)` Obtain a value of this type in its canonical form.
    `Comparator<?>` | `getComparator()`
    `String` | `getName()`
    `Class<?>` | `getValueClass()`
    `boolean` | `isTypeFor(Class<?> clazz)`
    `boolean` | `isTypeFor(Object value)`
    `boolean` | `isTypeForEach(Iterable<?> values)`
    `boolean` | `isTypeForEach(Iterator<?> values)`
    `static Iterator<PropertyType>` | `iterator()` Return an iterator over all the property type enumeration literals.
    `int` | `jcrType()` Returns the JCR numeric constant which represents the current type.
    `static PropertyType` | `valueFor(int jcrPropertyType)`
    `static PropertyType` | `valueFor(String typeNameInAnyCase)`
    `static PropertyType` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static PropertyType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### STRING

          public static final PropertyType STRING

    - #### BINARY

          public static final PropertyType BINARY

    - #### LONG

          public static final PropertyType LONG

    - #### DOUBLE

          public static final PropertyType DOUBLE

    - #### DECIMAL

          public static final PropertyType DECIMAL

    - #### DATE

          public static final PropertyType DATE

    - #### BOOLEAN

          public static final PropertyType BOOLEAN

    - #### NAME

          public static final PropertyType NAME

    - #### PATH

          public static final PropertyType PATH

    - #### REFERENCE

          public static final PropertyType REFERENCE

    - #### WEAKREFERENCE

          public static final PropertyType WEAKREFERENCE

    - #### SIMPLEREFERENCE

          public static final PropertyType SIMPLEREFERENCE

    - #### URI

          public static final PropertyType URI

    - #### OBJECT

          public static final PropertyType OBJECT

  - ### Method Detail

    - #### values

          public static PropertyType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (PropertyType c : PropertyType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static PropertyType valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### getValueClass

          public Class<?> getValueClass()

    - #### getName

          public String getName()

    - #### getComparator

          public Comparator<?> getComparator()

    - #### getCanonicalValue

          public Object getCanonicalValue(Object value)

      Obtain a value of this type in its canonical form. Some property types allow values to be instances of the canonical class or an alternative class. This method ensures that the value is always an instance of the canonical class.

      Note that this method does not cast from one property type to another.

      Parameters:
        `value` - the property value
      Returns:
        the value in canonical form

    - #### isTypeFor

          public final boolean isTypeFor(Object value)

    - #### isTypeFor

          public final boolean isTypeFor(Class<?> clazz)

    - #### isTypeForEach

          public final boolean isTypeForEach(Iterable<?> values)

    - #### isTypeForEach

          public final boolean isTypeForEach(Iterator<?> values)

    - #### jcrType

          public final int jcrType()

      Returns the JCR numeric constant which represents the current type.
      Returns:
        an `int` value
      See Also:
        `PropertyType`

    - #### discoverType

          public static PropertyType discoverType(Object value)

    - #### discoverType

          public static PropertyType discoverType(Class<?> clazz)

      Discover the most appropriate `PropertyType` whose values can be assigned to variables or parameters of the supplied type. This method does check whether the supplied `Class` is an array, in which case it just evalutes the `component type` of the array.
      Parameters:
        `clazz` - the class representing the type of a value or parameter; may not be null
      Returns:
        the PropertyType that best represents the type whose values can be used as a value in the supplied class, or null if no matching PropertyType could be found

    - #### iterator

          public static Iterator<PropertyType> iterator()

      Return an iterator over all the property type enumeration literals.
      Returns:
        an immutable iterator

    - #### valueFor

          public static PropertyType valueFor(String typeNameInAnyCase)

    - #### valueFor

          public static PropertyType valueFor(int jcrPropertyType)

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