|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.addon.jpacontainer.metadata.MetadataFactory
public class MetadataFactory
Factory for creating and populating ClassMetadata and
EntityClassMetadata instances.
| Constructor Summary | |
|---|---|
protected |
MetadataFactory()
|
| Method Summary | ||
|---|---|---|
protected PersistentPropertyMetadata.AccessType |
determineAccessType(Class<?> type)
|
|
protected void |
extractPropertiesFromFields(Class<?> type,
ClassMetadata<?> metadata)
|
|
protected void |
extractPropertiesFromMethods(Class<?> type,
ClassMetadata<?> metadata)
|
|
|
getClassMetadata(Class<T> mappedClass,
PersistentPropertyMetadata.AccessType accessType)
Extracts the class metadata from mappedClass. |
|
|
getEntityClassMetadata(Class<T> mappedClass)
Extracts the entity class metadata from mappedClass. |
|
static MetadataFactory |
getInstance()
Gets the singleton instance of this factory. |
|
protected boolean |
isCollection(AccessibleObject ab)
|
|
protected boolean |
isElementCollection(AccessibleObject ab)
|
|
protected boolean |
isEmbedded(AccessibleObject ab)
|
|
protected boolean |
isReference(AccessibleObject ab)
|
|
protected void |
loadProperties(Class<?> type,
ClassMetadata<?> metadata,
PersistentPropertyMetadata.AccessType accessType)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected MetadataFactory()
| Method Detail |
|---|
public static MetadataFactory getInstance()
public <T> EntityClassMetadata<T> getEntityClassMetadata(Class<T> mappedClass)
throws IllegalArgumentException
mappedClass. The
access type (field or method) will be determined from the location of the
Id or EmbeddedId annotation. If both of these are
missing, this method will fail. This method will also fail if
mappedClass lacks the Entity annotation.
mappedClass - the mapped class (must not be null).
IllegalArgumentException - if no metadata could be extracted.
public <T> ClassMetadata<T> getClassMetadata(Class<T> mappedClass,
PersistentPropertyMetadata.AccessType accessType)
throws IllegalArgumentException
mappedClass. If
mappedClass is Embeddable, the result will be an
instance of ClassMetadata. If mappedClass is an
Entity, the result will be an instance of
EntityClassMetadata.
accessType instructs the factory where to look for
annotations and which defaults to assume if there are no annotations.
mappedClass - the mapped class (must not be null).accessType - the location where to look for annotations (must not be null).
IllegalArgumentException - if no metadata could be extracted.
protected void loadProperties(Class<?> type,
ClassMetadata<?> metadata,
PersistentPropertyMetadata.AccessType accessType)
protected PersistentPropertyMetadata.AccessType determineAccessType(Class<?> type)
protected boolean isReference(AccessibleObject ab)
protected boolean isCollection(AccessibleObject ab)
protected boolean isEmbedded(AccessibleObject ab)
protected void extractPropertiesFromFields(Class<?> type,
ClassMetadata<?> metadata)
protected boolean isElementCollection(AccessibleObject ab)
protected void extractPropertiesFromMethods(Class<?> type,
ClassMetadata<?> metadata)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||