org.jaffa.tools.patternmetaengine
Class DomainObjectHelper

java.lang.Object
  extended byorg.jaffa.tools.patternmetaengine.DomainObjectHelper

public class DomainObjectHelper
extends Object

This helper reads in all the domain object xml files fron the specified locations

Version:
1.0
Author:
PaulE

Constructor Summary
DomainObjectHelper()
          Creates a new instance of DomainObjectHelper This looks at the supplied directory (path) and creates a map of all domain objects in that package.
 
Method Summary
 void doIgnoreFieldFilter(org.jaffa.patterns.library.domain_creator_1_1.domain.Root domain)
           
 void doIgnoreFilter()
          This goes through each domain removing any field where ignore = true It then goes through each relationship and if any of the from or to fields of that relationship don't exits, the relationship is removed.
 void doIgnoreRelationshipFilter(org.jaffa.patterns.library.domain_creator_1_1.domain.Root domain)
           
 org.jaffa.patterns.library.domain_creator_1_1.domain.Root getByDomain(String name)
          Get the domain object bean, based on the domain object name
 org.jaffa.patterns.library.domain_creator_1_1.domain.Root getByTable(String name)
          Get the domain object bean, based on the database table name
 boolean hasField(org.jaffa.patterns.library.domain_creator_1_1.domain.Root domain, String name)
           
 Iterator iterator()
          Return an iterator for all domain object loaded
 void loadObjects(File file, boolean recursive)
          Loads domain object from the specified location.
 void loadObjects(String file)
          Loads domain object from the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomainObjectHelper

public DomainObjectHelper()
Creates a new instance of DomainObjectHelper This looks at the supplied directory (path) and creates a map of all domain objects in that package.

Method Detail

loadObjects

public void loadObjects(String file)
Loads domain object from the specified location. If location is a file this file is loaded, if the location is a directory, all files in there are loaded recusivly.

Parameters:
file - name of file or folder to load

loadObjects

public void loadObjects(File file,
                        boolean recursive)
Loads domain object from the specified location. If location is a file this file is loaded, if the location is a directory, all files in there are loaded recusivly, if specified.

Parameters:
file - file or location to load
recursive - if loaction is a folder should subfolder be loaded as well (set to true for a recursive load)

getByDomain

public org.jaffa.patterns.library.domain_creator_1_1.domain.Root getByDomain(String name)
Get the domain object bean, based on the domain object name

Parameters:
name - domain object name
Returns:
root of domain object bean

getByTable

public org.jaffa.patterns.library.domain_creator_1_1.domain.Root getByTable(String name)
Get the domain object bean, based on the database table name

Parameters:
name - name of table
Returns:
root of domain object bean

iterator

public Iterator iterator()
Return an iterator for all domain object loaded

Returns:
iterator for all domain objects

doIgnoreFilter

public void doIgnoreFilter()
This goes through each domain removing any field where ignore = true It then goes through each relationship and if any of the from or to fields of that relationship don't exits, the relationship is removed.


doIgnoreFieldFilter

public void doIgnoreFieldFilter(org.jaffa.patterns.library.domain_creator_1_1.domain.Root domain)

doIgnoreRelationshipFilter

public void doIgnoreRelationshipFilter(org.jaffa.patterns.library.domain_creator_1_1.domain.Root domain)

hasField

public boolean hasField(org.jaffa.patterns.library.domain_creator_1_1.domain.Root domain,
                        String name)


Copyright © 2002-2004 JAFFA Project.