Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.openjpa.meta
Class JavaTypes

    java.lang.Object
      org.apache.openjpa.meta.JavaTypes

Direct Known Subclasses:
  JavaSQLTypes

    public class JavaTypes

extends Object

Type constants for managed fields.

Author:
  Abe White

Field Summary
`static int` | `ARRAY`
`static int` | `BIGDECIMAL`
`static int` | `BIGINTEGER`
`static int` | `BOOLEAN`
`static int` | `BOOLEAN_OBJ`
`static int` | `BYTE`
`static int` | `BYTE_OBJ`
`static int` | `CALENDAR`
`static int` | `CHAR`
`static int` | `CHAR_OBJ`
`static int` | `COLLECTION`
`static int` | `DATE`
`static int` | `DOUBLE`
`static int` | `DOUBLE_OBJ`
`static int` | `ENUM`
`static int` | `FLOAT`
`static int` | `FLOAT_OBJ`
`static int` | `INPUT_READER`
`static int` | `INPUT_STREAM`
`static int` | `INT`
`static int` | `INT_OBJ`
`static int` | `LOCALE`
`static int` | `LONG`
`static int` | `LONG_OBJ`
`static int` | `MAP`
`static int` | `NUMBER`
`static int` | `OBJECT`
`static int` | `OID`
`static int` | `PC`
`static int` | `PC_UNTYPED`
`static int` | `SHORT`
`static int` | `SHORT_OBJ`
`static int` | `STRING`

Constructor Summary
`JavaTypes()`

Method Summary
`static Class<?>` | `classForName(String name, ClassMetaData context)` Check the given name against the same set of standard packages used when parsing metadata.
`static Class<?>` | `classForName(String name, ClassMetaData context, ClassLoader loader)` Check the given name against the same set of standard packages used when parsing metadata.
`static Class<?>` | `classForName(String name, ClassMetaData context, ClassLoader loader, boolean mustExist)` Check the given name against the same set of standard packages used when parsing metadata.
`static Class<?>` | `classForName(String name, ValueMetaData context)` Check the given name against the same set of standard packages used when parsing metadata.
`static Class<?>` | `classForName(String name, ValueMetaData context, ClassLoader loader)` Check the given name against the same set of standard packages used when parsing metadata.
`static Class<?>` | `classForName(String name, ValueMetaData context, ClassLoader loader, boolean mustExist)` Try to load a class using the provided loader.
`static Object` | `convert(Object val, int typeCode)` Convert the given object to the given type if possible.
`static int` | `getTypeCode(Class<?> type)` Return the field metadata type code for the given class.
`static boolean` | `isPrimitiveDefault(Object o, int typeCode)` Determine whether or not the provided Object value is the default for the provided typeCode.
`static boolean` | `maybePC(FieldMetaData field)` Return true if the (possibly unresolved) field or its elements might be persistence capable objects.
`(package private) static boolean` | `maybePC(int typeCode, Class<?> type)` Return true if the given unresolved typecode/type pair may represent a persistent object.
`static boolean` | `maybePC(ValueMetaData val)` Return true if the (possibly unresolved) value might be a first class object.
`static Object` | `toArray(Collection<?> coll, Class<?> elem)` Helper method to return the given collection as an array.
`static
`<T> List<T>`
` | `toList(Object val, Class<T> elem, boolean mutable)` Helper method to return the given array value as a collection.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### BOOLEAN

    public static final int BOOLEAN

See Also:
  Constant Field Values

### BYTE

    public static final int BYTE

See Also:
  Constant Field Values

### CHAR

    public static final int CHAR

See Also:
  Constant Field Values

### DOUBLE

    public static final int DOUBLE

See Also:
  Constant Field Values

### FLOAT

    public static final int FLOAT

See Also:
  Constant Field Values

### INT

    public static final int INT

See Also:
  Constant Field Values

### LONG

    public static final int LONG

See Also:
  Constant Field Values

### SHORT

    public static final int SHORT

See Also:
  Constant Field Values

### OBJECT

    public static final int OBJECT

See Also:
  Constant Field Values

### STRING

    public static final int STRING

See Also:
  Constant Field Values

### NUMBER

    public static final int NUMBER

See Also:
  Constant Field Values

### ARRAY

    public static final int ARRAY

See Also:
  Constant Field Values

### COLLECTION

    public static final int COLLECTION

See Also:
  Constant Field Values

### MAP

    public static final int MAP

See Also:
  Constant Field Values

### DATE

    public static final int DATE

See Also:
  Constant Field Values

### PC

    public static final int PC

See Also:
  Constant Field Values

### BOOLEAN_OBJ

    public static final int BOOLEAN_OBJ

See Also:
  Constant Field Values

### BYTE_OBJ

    public static final int BYTE_OBJ

See Also:
  Constant Field Values

### CHAR_OBJ

    public static final int CHAR_OBJ

See Also:
  Constant Field Values

### DOUBLE_OBJ

    public static final int DOUBLE_OBJ

See Also:
  Constant Field Values

### FLOAT_OBJ

    public static final int FLOAT_OBJ

See Also:
  Constant Field Values

### INT_OBJ

    public static final int INT_OBJ

See Also:
  Constant Field Values

### LONG_OBJ

    public static final int LONG_OBJ

See Also:
  Constant Field Values

### SHORT_OBJ

    public static final int SHORT_OBJ

See Also:
  Constant Field Values

### BIGDECIMAL

    public static final int BIGDECIMAL

See Also:
  Constant Field Values

### BIGINTEGER

    public static final int BIGINTEGER

See Also:
  Constant Field Values

### LOCALE

    public static final int LOCALE

See Also:
  Constant Field Values

### PC_UNTYPED

    public static final int PC_UNTYPED

See Also:
  Constant Field Values

### CALENDAR

    public static final int CALENDAR

See Also:
  Constant Field Values

### OID

    public static final int OID

See Also:
  Constant Field Values

### INPUT_STREAM

    public static final int INPUT_STREAM

See Also:
  Constant Field Values

### INPUT_READER

    public static final int INPUT_READER

See Also:
  Constant Field Values

### ENUM

    public static final int ENUM

See Also:
  Constant Field Values

Constructor Detail

### JavaTypes

    public JavaTypes()

Method Detail

### getTypeCode

    public static int getTypeCode(Class<?> type)

  Return the field metadata type code for the given class. First class objects are not recognized in this method.

### classForName

    public static Class<?> classForName(String name,
                                        ClassMetaData context)

  Check the given name against the same set of standard packages used when parsing metadata.

### classForName

    public static Class<?> classForName(String name,
                                        ClassMetaData context,
                                        ClassLoader loader)

  Check the given name against the same set of standard packages used when parsing metadata.

### classForName

    public static Class<?> classForName(String name,
                                        ClassMetaData context,
                                        ClassLoader loader,
                                        boolean mustExist)

  Check the given name against the same set of standard packages used when parsing metadata.

  Parameters:
    `mustExist` - Whether the supplied loader must be able to load the class. If true no attempt to use a different classloader will be made. If false the ClassResolver from the configuration will be used.

### classForName

    public static Class<?> classForName(String name,
                                        ValueMetaData context)

  Check the given name against the same set of standard packages used when parsing metadata.

### classForName

    public static Class<?> classForName(String name,
                                        ValueMetaData context,
                                        ClassLoader loader)

  Check the given name against the same set of standard packages used when parsing metadata.

### classForName

    public static Class<?> classForName(String name,
                                        ValueMetaData context,
                                        ClassLoader loader,
                                        boolean mustExist)

  Try to load a class using the provided loader. Optionally tries the configuration's ClassResolver if the supplied loader cannot find the class.

  Parameters:
    `name` - Name of the class to load.
    `context` -
    `loader` - ClassLoader to use. If null, the configuration's ClassResolver will be used.
    `mustExist` - Whether the supplied loader must be able to load the class. If true no attempt to use a different classloader will be made. If false the ClassResolver from the configuration will be used.

### convert

    public static Object convert(Object val,
                                 int typeCode)

  Convert the given object to the given type if possible. If the type is a numeric primitive, this method only guarantees that the return value is a `Number`. If no known conversion or the value is null, returns the original value.

### maybePC

    public static boolean maybePC(FieldMetaData field)

  Return true if the (possibly unresolved) field or its elements might be persistence capable objects.

### maybePC

    public static boolean maybePC(ValueMetaData val)

  Return true if the (possibly unresolved) value might be a first class object.

### maybePC

    static boolean maybePC(int typeCode,
                           Class<?> type)

  Return true if the given unresolved typecode/type pair may represent a persistent object.

### toList

    public static <T> List<T> toList(Object val,
                                     Class<T> elem,
                                     boolean mutable)

  Helper method to return the given array value as a collection.

### toArray

    public static Object toArray(Collection<?> coll,
                                 Class<?> elem)

  Helper method to return the given collection as an array.

### isPrimitiveDefault

    public static boolean isPrimitiveDefault(Object o,
                                             int typeCode)

  Determine whether or not the provided Object value is the default for the provided typeCode. For example: If o = Integer(0) and typeCode = JavaTypes.INT, this method will return true.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.