org.apache.jackrabbit.ocm.mapper.model
Class ClassDescriptor

java.lang.Object
  extended by org.apache.jackrabbit.ocm.mapper.model.ClassDescriptor

public class ClassDescriptor
extends Object

ClassDescriptor is used by the mapper to read general information on a class

Author:
Lombart Christophe , Alexandru Popescu

Constructor Summary
ClassDescriptor()
           
 
Method Summary
 void addBeanDescriptor(BeanDescriptor beanDescriptor)
          Add a new BeanDescriptor
 void addCollectionDescriptor(CollectionDescriptor collectionDescriptor)
          Add a new CollectionDescriptor
 void addDescendantClassDescriptor(ClassDescriptor classDescriptor)
           
 void addFieldDescriptor(FieldDescriptor fieldDescriptor)
          Add a new FielDescriptor
 void addImplementDescriptor(ImplementDescriptor implementDescriptor)
           
 void afterPropertiesSet()
          Revisit information in this descriptor and fills in more.
 BeanDescriptor getBeanDescriptor(String fieldName)
          Get the BeanDescriptor to used for a specific java bean attribute
 Collection getBeanDescriptors()
           
 String getClassName()
           
 CollectionDescriptor getCollectionDescriptor(String fieldName)
          Get the CollectionDescriptor to used for a specific java bean attribute
 Collection getCollectionDescriptors()
           
 ClassDescriptor getDescendantClassDescriptor(String nodeType)
          If the node type per concrete class strategy is used, we need to find a descendant class descriptor assigned to a node type This method is not used in other situation.
 Collection getDescendantClassDescriptors()
           
 String getExtend()
           
 FieldDescriptor getFieldDescriptor(String fieldName)
          Get the FieldDescriptor to used for a specific java bean attribute
 Collection getFieldDescriptors()
           
 Map getFieldNames()
           
 FieldDescriptor getIdFieldDescriptor()
           
 Set getImplements()
           
 String[] getJcrMixinTypes()
          Retrieve the mixin types.
 String getJcrName(String fieldName)
          Get the JCR name used for one of the object attributes
 String getJcrSuperTypes()
          Get the JCR node super types.
 String getJcrType()
           
 MappingDescriptor getMappingDescriptor()
           
 FieldDescriptor getPathFieldDescriptor()
           
 ClassDescriptor getSuperClassDescriptor()
           
 FieldDescriptor getUuidFieldDescriptor()
           
 boolean hasDescendants()
           
 boolean hasDiscriminator()
           
 boolean hasIdField()
          Check if this class has an ID
 boolean hasInterfaces()
           
 boolean hasUUIdField()
          Check if this class has an UUID
 boolean isAbstract()
           
 boolean isInterface()
           
 void setAbstract(boolean flag)
           
 void setClassName(String className)
           
 void setDiscriminator(boolean flag)
           
 void setExtend(String className)
           
 void setImplements(Set interfaces)
           
 void setInterface(boolean flag)
           
 void setJcrMixinTypes(String mixinTypes)
           
 void setJcrMixinTypes(String[] mixinTypes)
          Sets a comma separated list of mixin types.
 void setJcrSuperTypes(String superTypes)
          Setter for JCR super types.
 void setJcrType(String jcrType)
           
 void setMappingDescriptor(MappingDescriptor mappingDescriptor)
           
 void setSuperClassDescriptor(ClassDescriptor superClassDescriptor)
           
 String toString()
           
 boolean usesNodeTypePerConcreteClassStrategy()
           
 boolean usesNodeTypePerHierarchyStrategy()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassDescriptor

public ClassDescriptor()
Method Detail

setAbstract

public void setAbstract(boolean flag)

isAbstract

public boolean isAbstract()

setInterface

public void setInterface(boolean flag)

isInterface

public boolean isInterface()

hasInterfaces

public boolean hasInterfaces()

setDiscriminator

public void setDiscriminator(boolean flag)

hasDiscriminator

public boolean hasDiscriminator()

usesNodeTypePerHierarchyStrategy

public boolean usesNodeTypePerHierarchyStrategy()

usesNodeTypePerConcreteClassStrategy

public boolean usesNodeTypePerConcreteClassStrategy()

getClassName

public String getClassName()
Returns:
Returns the className.

setClassName

public void setClassName(String className)
Parameters:
className - The className to set.

getJcrType

public String getJcrType()
Returns:
Returns the jcrType.

setJcrType

public void setJcrType(String jcrType)
Parameters:
jcrType - The jcrType to set.

addFieldDescriptor

public void addFieldDescriptor(FieldDescriptor fieldDescriptor)
Add a new FielDescriptor

Parameters:
fieldDescriptor - the new field descriptor to add

addImplementDescriptor

public void addImplementDescriptor(ImplementDescriptor implementDescriptor)

getFieldDescriptor

public FieldDescriptor getFieldDescriptor(String fieldName)
Get the FieldDescriptor to used for a specific java bean attribute

Parameters:
fieldName - The java bean attribute name
Returns:
the FieldDescriptor found or null

getFieldDescriptors

public Collection getFieldDescriptors()
Returns:
all FieldDescriptor defined in this ClassDescriptor

addBeanDescriptor

public void addBeanDescriptor(BeanDescriptor beanDescriptor)
Add a new BeanDescriptor

Parameters:
beanDescriptor - the new bean descriptor to add

getBeanDescriptor

public BeanDescriptor getBeanDescriptor(String fieldName)
Get the BeanDescriptor to used for a specific java bean attribute

Parameters:
fieldName - The java bean attribute name
Returns:
the BeanDescriptor found or null

getBeanDescriptors

public Collection getBeanDescriptors()
Returns:
all BeanDescriptor defined in this ClassDescriptor

addCollectionDescriptor

public void addCollectionDescriptor(CollectionDescriptor collectionDescriptor)
Add a new CollectionDescriptor

Parameters:
collectionDescriptor - the new collection descriptor to add

getCollectionDescriptor

public CollectionDescriptor getCollectionDescriptor(String fieldName)
Get the CollectionDescriptor to used for a specific java bean attribute

Parameters:
fieldName - The java bean attribute name
Returns:
the CollectionDescriptor found or null

getCollectionDescriptors

public Collection getCollectionDescriptors()
Returns:
all BeanDescriptor defined in this ClassDescriptor

getIdFieldDescriptor

public FieldDescriptor getIdFieldDescriptor()
Returns:
the fieldDescriptor ID

getPathFieldDescriptor

public FieldDescriptor getPathFieldDescriptor()
Returns:
the fieldDescriptor path

getUuidFieldDescriptor

public FieldDescriptor getUuidFieldDescriptor()
Returns:
the fieldDescriptor path

hasIdField

public boolean hasIdField()
Check if this class has an ID

Returns:
true if the class has an ID

hasUUIdField

public boolean hasUUIdField()
Check if this class has an UUID

Returns:
true if the class has an UUID

getJcrName

public String getJcrName(String fieldName)
Get the JCR name used for one of the object attributes

Parameters:
fieldName - the object attribute name (can be an atomic field, bean field or a collection field)
Returns:
the JCR name found

getFieldNames

public Map getFieldNames()

getJcrSuperTypes

public String getJcrSuperTypes()
Get the JCR node super types.

Returns:
jcrSuperTypes

setJcrSuperTypes

public void setJcrSuperTypes(String superTypes)
Setter for JCR super types.

Parameters:
superTypes - Comma separated list of JCR node super types

getJcrMixinTypes

public String[] getJcrMixinTypes()
Retrieve the mixin types.

Returns:
array of mixin types

setJcrMixinTypes

public void setJcrMixinTypes(String[] mixinTypes)
Sets a comma separated list of mixin types.

Parameters:
mixinTypes - command separated list of mixins

setJcrMixinTypes

public void setJcrMixinTypes(String mixinTypes)

getMappingDescriptor

public MappingDescriptor getMappingDescriptor()
Returns:
Returns the mappingDescriptor.

setMappingDescriptor

public void setMappingDescriptor(MappingDescriptor mappingDescriptor)
Parameters:
mappingDescriptor - The mappingDescriptor to set.

afterPropertiesSet

public void afterPropertiesSet()
Revisit information in this descriptor and fills in more.


getExtend

public String getExtend()
Returns:
return the super class name if defined in mapping, or null if not set

setExtend

public void setExtend(String className)
Parameters:
className -

getSuperClassDescriptor

public ClassDescriptor getSuperClassDescriptor()
Returns:
Returns the superClassDescriptor.

getDescendantClassDescriptors

public Collection getDescendantClassDescriptors()

getDescendantClassDescriptor

public ClassDescriptor getDescendantClassDescriptor(String nodeType)
If the node type per concrete class strategy is used, we need to find a descendant class descriptor assigned to a node type This method is not used in other situation.

Parameters:
nodeType - the node type for which the classdescriptor is required
Returns:
the classdescriptor found or null

addDescendantClassDescriptor

public void addDescendantClassDescriptor(ClassDescriptor classDescriptor)

hasDescendants

public boolean hasDescendants()

setSuperClassDescriptor

public void setSuperClassDescriptor(ClassDescriptor superClassDescriptor)
Parameters:
superClassDescriptor - The superClassDescriptor to set.

getImplements

public Set getImplements()

setImplements

public void setImplements(Set interfaces)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.