org.apache.portals.graffito.jcr.mapper.model
Class ClassDescriptor

java.lang.Object
  extended by org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor

public class ClassDescriptor
extends java.lang.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(java.lang.String fieldName)
          Get the BeanDescriptor to used for a specific java bean attribute
 java.util.Collection getBeanDescriptors()
           
 java.lang.String getClassName()
           
 CollectionDescriptor getCollectionDescriptor(java.lang.String fieldName)
          Get the CollectionDescriptor to used for a specific java bean attribute
 java.util.Collection getCollectionDescriptors()
           
 ClassDescriptor getDescendantClassDescriptor(java.lang.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.
 java.util.Collection getDescendantClassDescriptors()
           
 java.lang.String getExtend()
           
 FieldDescriptor getFieldDescriptor(java.lang.String fieldName)
          Get the FieldDescriptor to used for a specific java bean attribute
 java.util.Collection getFieldDescriptors()
           
 java.util.Map getFieldNames()
           
 FieldDescriptor getIdFieldDescriptor()
           
 java.util.Collection getImplements()
           
 java.lang.String[] getJcrMixinTypes()
          Retrieve the mixin types.
 java.lang.String getJcrName(java.lang.String fieldName)
          Get the JCR name used for one of the object attributes
 java.lang.String getJcrNodeType()
           
 java.lang.String getJcrSuperTypes()
          Get the JCR node super types.
 MappingDescriptor getMappingDescriptor()
           
 FieldDescriptor getPathFieldDescriptor()
           
 ClassDescriptor getSuperClassDescriptor()
           
 boolean hasDescendants()
           
 boolean hasDiscriminator()
           
 boolean hasIdField()
          Check if this class has an ID
 boolean hasInterfaces()
           
 boolean isAbstract()
           
 boolean isInterface()
           
 void setAbstract(boolean flag)
           
 void setClassName(java.lang.String className)
           
 void setDiscriminator(boolean flag)
           
 void setExtend(java.lang.String className)
           
 void setInterface(boolean flag)
           
 void setJcrMixinTypes(java.lang.String[] mixinTypes)
          Sets a comma separated list of mixin types.
 void setJcrNodeType(java.lang.String jcrNodeType)
           
 void setJcrSuperTypes(java.lang.String superTypes)
          Setter for JCR super types.
 void setMappingDescriptor(MappingDescriptor mappingDescriptor)
           
 void setSuperClassDescriptor(ClassDescriptor superClassDescriptor)
           
 java.lang.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 java.lang.String getClassName()
Returns:
Returns the className.

setClassName

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

getJcrNodeType

public java.lang.String getJcrNodeType()
Returns:
Returns the jcrNodeType.

setJcrNodeType

public void setJcrNodeType(java.lang.String jcrNodeType)
Parameters:
jcrNodeType - The jcrNodeType 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(java.lang.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 java.util.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(java.lang.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 java.util.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(java.lang.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 java.util.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

hasIdField

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

Returns:
true if the class has an ID

getJcrName

public java.lang.String getJcrName(java.lang.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 java.util.Map getFieldNames()

getJcrSuperTypes

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

Returns:
jcrSuperTypes

setJcrSuperTypes

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

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

getJcrMixinTypes

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

Returns:
array of mixin types

setJcrMixinTypes

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

Parameters:
mixinTypes - command separated list of mixins

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 java.lang.String getExtend()
Returns:
return the super class name if defined in mapping, or null if not set

setExtend

public void setExtend(java.lang.String className)
Parameters:
className -

getSuperClassDescriptor

public ClassDescriptor getSuperClassDescriptor()
Returns:
Returns the superClassDescriptor.

getDescendantClassDescriptors

public java.util.Collection getDescendantClassDescriptors()

getDescendantClassDescriptor

public ClassDescriptor getDescendantClassDescriptor(java.lang.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 java.util.Collection getImplements()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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