org.caleigo.core
Class CompositeEntityDescriptor.Builder

java.lang.Object
  extended byorg.caleigo.core.CompositeEntityDescriptor.Builder
Enclosing class:
CompositeEntityDescriptor

public static class CompositeEntityDescriptor.Builder
extends java.lang.Object

The FieldGroupBuilder is a builder that builds a tree (of fields- and field-groups) in a top-down manner. But most users shouldn't have to worry about internal structur and that's why we provide the builder.


Constructor Summary
CompositeEntityDescriptor.Builder(IEntityDescriptor entityDescriptor)
           
CompositeEntityDescriptor.Builder(IEntityDescriptor entityDescriptor, java.lang.String entityIdentity)
           
CompositeEntityDescriptor.Builder(IEntityDescriptor entityDescriptor, java.lang.String entityIdentity, boolean required)
          Instantiate a new FieldGroupBuilder and begins the first group and make it the tree's root.
 
Method Summary
 void addFieldDescriptor(IFieldDescriptor field)
           
 void addFieldDescriptor(IFieldDescriptor field, java.lang.String codeName, java.lang.String displayName)
           
 void addFieldDescriptor(IFieldDescriptor field, java.lang.String codeName, java.lang.String displayName, int flags)
          Add a field to the current field group.
 void beginFieldGroup(IEntityDescriptor entityDescriptor)
           
 void beginFieldGroup(IEntityDescriptor entityDescriptor, IEntityRelationPath parentToChildPath)
           
 void beginFieldGroup(IEntityDescriptor entityDescriptor, java.lang.String entityIdentity)
           
 void beginFieldGroup(IEntityDescriptor entityDescriptor, java.lang.String entityIdentity, boolean required)
           
 void beginFieldGroup(IEntityDescriptor entityDescriptor, java.lang.String entityIdentity, IEntityRelationPath parentToChildPath)
           
 void beginFieldGroup(IEntityDescriptor entityDescriptor, java.lang.String entityIdentity, IEntityRelationPath parentToChildPath, boolean required)
          Create a new field group and add it to the current field group as a child, i.e. let this newly created field group be the parent of future childs i.e. make a new tree branch.
 ICompositeEntityDescriptor createCompositeEntityDescriptor(java.lang.String codeName, java.lang.String displayName, java.lang.String dataSourceClassName, int entityType)
           
 void endFieldGroup()
          Ends the current field group and climp up one level in the tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeEntityDescriptor.Builder

public CompositeEntityDescriptor.Builder(IEntityDescriptor entityDescriptor)

CompositeEntityDescriptor.Builder

public CompositeEntityDescriptor.Builder(IEntityDescriptor entityDescriptor,
                                         java.lang.String entityIdentity)

CompositeEntityDescriptor.Builder

public CompositeEntityDescriptor.Builder(IEntityDescriptor entityDescriptor,
                                         java.lang.String entityIdentity,
                                         boolean required)
Instantiate a new FieldGroupBuilder and begins the first group and make it the tree's root. Next step would be to call one of the addField()-methods and then maybe one of the beginGroup()-methods.

Parameters:
entityDescriptor -
entityIdentity - id for the root field group.
required - determines what kind of joins that are to be made: left/right/full outer join / inner join.
See Also:
ICompositeEntityDescriptor.ICompositeFieldGroup.getRequired()
Method Detail

beginFieldGroup

public void beginFieldGroup(IEntityDescriptor entityDescriptor)

beginFieldGroup

public void beginFieldGroup(IEntityDescriptor entityDescriptor,
                            java.lang.String entityIdentity)

beginFieldGroup

public void beginFieldGroup(IEntityDescriptor entityDescriptor,
                            IEntityRelationPath parentToChildPath)

beginFieldGroup

public void beginFieldGroup(IEntityDescriptor entityDescriptor,
                            java.lang.String entityIdentity,
                            boolean required)

beginFieldGroup

public void beginFieldGroup(IEntityDescriptor entityDescriptor,
                            java.lang.String entityIdentity,
                            IEntityRelationPath parentToChildPath)

beginFieldGroup

public void beginFieldGroup(IEntityDescriptor entityDescriptor,
                            java.lang.String entityIdentity,
                            IEntityRelationPath parentToChildPath,
                            boolean required)
Create a new field group and add it to the current field group as a child, i.e. let this newly created field group be the parent of future childs i.e. make a new tree branch.

Parameters:
entityDescriptor - is the entity descriptor that all added fields should be belong to. All added child field group will be joined to this one.???????????????????????????????????????????????????????????????????????????????????????????
entityIdentity - is the named identity of the created field group. It's optional. This will normally be the code name of the base entity descriptor unless multiple instances of the descriptor exists in the field group structure.
required - determines whether or not this field group's fields are required or not in joins.
See Also:
CompositeEntityDescriptor.CompositeFieldGroup#CompositeFieldGroup(IBaseEntityDescriptor iBaseEntityDescriptor, String entityIdentity, IEntityRelationPath parentRelationPath, boolean required), ICompositeEntityDescriptor.ICompositeFieldGroup.getRequired()

addFieldDescriptor

public void addFieldDescriptor(IFieldDescriptor field)

addFieldDescriptor

public void addFieldDescriptor(IFieldDescriptor field,
                               java.lang.String codeName,
                               java.lang.String displayName)

addFieldDescriptor

public void addFieldDescriptor(IFieldDescriptor field,
                               java.lang.String codeName,
                               java.lang.String displayName,
                               int flags)
Add a field to the current field group. Call to this method is allowed both before and after adding field groups (with any of the beginFieldGroup-methods). Compare to files and directories in file-systems!

See Also:
CompositeEntityDescriptor.CompositeFieldGroup#addFieldDescriptor(IFieldDescriptor field, String codeName, String displayName, int flags)

endFieldGroup

public void endFieldGroup()
Ends the current field group and climp up one level in the tree. Throws an InvalidDescriptorException if the current field group doesn't contain any fields! Extra closings at the top level are ignored.


createCompositeEntityDescriptor

public ICompositeEntityDescriptor createCompositeEntityDescriptor(java.lang.String codeName,
                                                                  java.lang.String displayName,
                                                                  java.lang.String dataSourceClassName,
                                                                  int entityType)
Returns:
a created ICompositeEntityDescriptor which wraps a field group tree and it's current children (fields and field-groups). After calling this method it's ok to add more children and then call it again.
See Also:
CompositeEntityDescriptor#CompositeEntityDescriptor(String codeName, String displayName, String dataSourceClassName, int entityType, IFieldDescriptor[] fieldDescriptors, Qualifier defaultQualifier)


Copyright © 2005 Caleigo. All Rights Reserved.