com.trg.search.jpa
Class JPAAnnotationMetadata

java.lang.Object
  extended by com.trg.search.jpa.JPAAnnotationMetadata
All Implemented Interfaces:
Metadata

public class JPAAnnotationMetadata
extends java.lang.Object
implements Metadata


Method Summary
 java.lang.Class<?> getCollectionClass()
          If the type is a collection, return the Java class of the collection itself, not the Java class of it's elements as with Metadata.getJavaClass().
 java.lang.String getIdProperty()
          Return the name of the id property of this type.
 Metadata getIdType()
          Return the metadata for the id property of this type.
 java.io.Serializable getIdValue(java.lang.Object object)
          Return the value of the id property of the given object of this type.
 java.lang.Class<?> getJavaClass()
          Return the Java class of this type.
static
<T> Metadata
getMetadata(java.lang.reflect.Type type)
           
 java.lang.String[] getProperties()
          Return an array of the names of all the properties that this type has, if any.
 Metadata getPropertyType(java.lang.String property)
          Return the metadata for the given property of this type.
 java.lang.Object getPropertyValue(java.lang.Object object, java.lang.String property)
          Return the value of the given property of the given object of this type.
 java.util.Map<java.lang.String,com.trg.search.jpa.JPAAnnotationMetadata.Property> getProps()
           
static java.lang.String[] getterName(java.lang.reflect.Method method)
           
 boolean isCollection()
          Return true if the type is a collection.
 boolean isEmeddable()
          Return true if the type is an embeddable class (a component class in Hibernate).
 boolean isEntity()
          Return true if the type is an entity.
 boolean isNumeric()
          Return true if the type is a number.
 boolean isString()
          Return true if the type is persisted as a string (char or varchar) type in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMetadata

public static <T> Metadata getMetadata(java.lang.reflect.Type type)

getCollectionClass

public java.lang.Class<?> getCollectionClass()
Description copied from interface: Metadata
If the type is a collection, return the Java class of the collection itself, not the Java class of it's elements as with Metadata.getJavaClass(). For example: ArrayList<Project>, Set<Person>, String[].

Specified by:
getCollectionClass in interface Metadata

getIdProperty

public java.lang.String getIdProperty()
Description copied from interface: Metadata
Return the name of the id property of this type. Return null if this is not an entity type.

Specified by:
getIdProperty in interface Metadata

getIdType

public Metadata getIdType()
Description copied from interface: Metadata
Return the metadata for the id property of this type. Return null if this is not an entity type.

Specified by:
getIdType in interface Metadata

getIdValue

public java.io.Serializable getIdValue(java.lang.Object object)
Description copied from interface: Metadata
Return the value of the id property of the given object of this type. Return null if this is not an entity type.

Specified by:
getIdValue in interface Metadata

getJavaClass

public java.lang.Class<?> getJavaClass()
Description copied from interface: Metadata
Return the Java class of this type. If the type is a collection, return the type of the collection elements.

Specified by:
getJavaClass in interface Metadata

getProperties

public java.lang.String[] getProperties()
Description copied from interface: Metadata
Return an array of the names of all the properties that this type has, if any. Return null if this a simple value type with no properties.

Specified by:
getProperties in interface Metadata

getPropertyType

public Metadata getPropertyType(java.lang.String property)
Description copied from interface: Metadata
Return the metadata for the given property of this type. Return null if this a simple value type with no properties.

Specified by:
getPropertyType in interface Metadata

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object object,
                                         java.lang.String property)
Description copied from interface: Metadata
Return the value of the given property of the given object of this type. Return null if this a simple value type with no properties.

Specified by:
getPropertyValue in interface Metadata

isCollection

public boolean isCollection()
Description copied from interface: Metadata
Return true if the type is a collection.

Specified by:
isCollection in interface Metadata

isEmeddable

public boolean isEmeddable()
Description copied from interface: Metadata
Return true if the type is an embeddable class (a component class in Hibernate).

Specified by:
isEmeddable in interface Metadata

isEntity

public boolean isEntity()
Description copied from interface: Metadata
Return true if the type is an entity.

Specified by:
isEntity in interface Metadata

isNumeric

public boolean isNumeric()
Description copied from interface: Metadata
Return true if the type is a number. For example: int, Float, Number, double, etc.

Specified by:
isNumeric in interface Metadata

isString

public boolean isString()
Description copied from interface: Metadata
Return true if the type is persisted as a string (char or varchar) type in the database.

Specified by:
isString in interface Metadata

getProps

public java.util.Map<java.lang.String,com.trg.search.jpa.JPAAnnotationMetadata.Property> getProps()

getterName

public static java.lang.String[] getterName(java.lang.reflect.Method method)


Copyright © 2008-2010 eBM WebSourcing. All Rights Reserved.