org.castor.jdo.jpa.info
Class ClassInfoBuilder

java.lang.Object
  extended by org.castor.jdo.jpa.info.ClassInfoBuilder

public class ClassInfoBuilder
extends java.lang.Object

Uses a JPA annotated Class to build ClassInfo and FieldInfos of it and parse the mapping information in them. For now, all fields are mapped as normal fields. No keys fields are recognized.

Since:
1.3
Author:
Peter Schmidt

Constructor Summary
ClassInfoBuilder()
          Create a new ClassInfoBuilder with the JPA annotation capable AnnotationProcessingServices.
 
Method Summary
 ClassInfo buildClassInfo(java.lang.Class<?> type)
          Builds a new ClassInfo describing the given Class.
 AnnotationProcessingService getClassAnnotationProcessingService()
           
 AnnotationProcessingService getFieldAnnotationProcessingService()
           
 void setClassAnnotationProcessingService(AnnotationProcessingService annotationProcessingService)
          Set the AnnotationProcessingService used to read the classes annotations.
 void setFieldAnnotationProcessingService(AnnotationProcessingService annotationProcessingService)
          Set the AnnotationProcessingService used to read annotations of the classes fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassInfoBuilder

public ClassInfoBuilder()
Create a new ClassInfoBuilder with the JPA annotation capable AnnotationProcessingServices.

Method Detail

getClassAnnotationProcessingService

public final AnnotationProcessingService getClassAnnotationProcessingService()
Returns:
the AnnotationProcessingService used to read annotations of the class.

setClassAnnotationProcessingService

public final void setClassAnnotationProcessingService(AnnotationProcessingService annotationProcessingService)
Set the AnnotationProcessingService used to read the classes annotations.

Parameters:
annotationProcessingService - the AnnotationProcessingService used to read the classes annotations.

getFieldAnnotationProcessingService

public final AnnotationProcessingService getFieldAnnotationProcessingService()
Returns:
the AnnotationProcessingService used to read annotations of the classes fields.

setFieldAnnotationProcessingService

public final void setFieldAnnotationProcessingService(AnnotationProcessingService annotationProcessingService)
Set the AnnotationProcessingService used to read annotations of the classes fields.

Parameters:
annotationProcessingService - the AnnotationProcessingService used to read annotations of the classes fields.

buildClassInfo

public final ClassInfo buildClassInfo(java.lang.Class<?> type)
                               throws MappingException
Builds a new ClassInfo describing the given Class. Annotations for the class and its fields are read using the AnnotationProcessingServices defined by {@link #setClassAnnotationProcessingService(AnnotationProcessingService) and

Parameters:
type - The Class Object representing the Class that shall be described.
Returns:
a new ClassInfo describing the given Class.
Throws:
MappingException - if annotation placement is invalid (field and property access for the same field).


Copyright © 2011. All Rights Reserved.