com.bowstreet.generation
Class BuilderManager

java.lang.Object
  extended by com.bowstreet.generation.BuilderManager

public abstract class BuilderManager
extends java.lang.Object

BuilderManager is a Singleton which provides access to all of the BuilderDefs


Field Summary
static java.lang.String GROUP_SEPARATOR
           
static char GROUP_SEPARATOR_CHAR
           
static java.lang.String RESOURCE_SUFFIX
           
static java.lang.String RESOURCE_SUFFIX_WITH_EXT
           
 
Method Summary
 void addBuilderToDomain(java.lang.String builderId, java.lang.String domainName, BuilderDef builder)
           
 java.util.Collection getAddFromPaletteListenterBuilderDefs()
          Get the collection of BuilderDefs that can listen to add from palette events
 BuilderDef getBuilderDef(java.lang.String builderId)
          Get an individual builderDef.
 java.util.Iterator getBuilderDefs(boolean update)
          Get an iterator to all the BuilderDefs
 java.util.Iterator getBuilderDefs(java.lang.String domainName)
          This will get all the Builders that belong to a particular domain.
 java.util.Collection getCanCreateBuilderDefs(java.lang.String typeOfElement)
          Get the collection of BuilderDefs that can create this sort of thing
 java.util.Collection getCanCreateTypeList()
          Get the collection of all the types of things builders know that they can create
 java.util.Collection getCanModifyBuilderDefs(GenElement genElement)
          Get the collection of BuilderDefs that can modify the thing that the GenElement represents
 java.util.Iterator getDomainNames(boolean update)
          Get an iterator to all the Domain names
static java.util.ResourceBundle getLocalizationResource(java.lang.String builderId)
          This will find the correct localization resource to use for this BuilderDef.
static BuilderManager getManager()
          Get the (singleton) BuilderManager, which will always extend this class.
 boolean isBuilderDefAvailable(java.lang.String builderId, java.lang.String domainName)
          Determines if a BuilderDef is available
 void updateBuilder(BuilderDef builder)
          Update the builder record that is cached.
 void updateBuilderFromFile(java.lang.String filename)
          this is used when it is detected that the builder file has changed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GROUP_SEPARATOR

public static final java.lang.String GROUP_SEPARATOR
See Also:
Constant Field Values

GROUP_SEPARATOR_CHAR

public static final char GROUP_SEPARATOR_CHAR
See Also:
Constant Field Values

RESOURCE_SUFFIX

public static final java.lang.String RESOURCE_SUFFIX
See Also:
Constant Field Values

RESOURCE_SUFFIX_WITH_EXT

public static final java.lang.String RESOURCE_SUFFIX_WITH_EXT
See Also:
Constant Field Values
Method Detail

addBuilderToDomain

public void addBuilderToDomain(java.lang.String builderId,
                               java.lang.String domainName,
                               BuilderDef builder)

getAddFromPaletteListenterBuilderDefs

public java.util.Collection getAddFromPaletteListenterBuilderDefs()
Get the collection of BuilderDefs that can listen to add from palette events

Returns:
Collection of BuilderDefs

getBuilderDef

public BuilderDef getBuilderDef(java.lang.String builderId)
Get an individual builderDef.

Parameters:
builderId - ID of the Builderdef to get
Returns:
BuilderDef

getBuilderDefs

public java.util.Iterator getBuilderDefs(boolean update)
Get an iterator to all the BuilderDefs

Parameters:
update - Force a reload of all builderdefs first
Returns:
iterator to a list of BuilderDef objects

getBuilderDefs

public java.util.Iterator getBuilderDefs(java.lang.String domainName)
This will get all the Builders that belong to a particular domain.

Parameters:
domainName -
Returns:
iterator to a list of BuilderDef objects

getCanCreateBuilderDefs

public java.util.Collection getCanCreateBuilderDefs(java.lang.String typeOfElement)
Get the collection of BuilderDefs that can create this sort of thing

Parameters:
typeOfElement -
Returns:
Collection of BuilderReferences

getCanCreateTypeList

public java.util.Collection getCanCreateTypeList()
Get the collection of all the types of things builders know that they can create

Returns:
Collection of Strings

getCanModifyBuilderDefs

public java.util.Collection getCanModifyBuilderDefs(GenElement genElement)
Get the collection of BuilderDefs that can modify the thing that the GenElement represents

Parameters:
genElement -
Returns:
Collection of BuilderReferences

getDomainNames

public java.util.Iterator getDomainNames(boolean update)
Get an iterator to all the Domain names

Parameters:
update - Force a reload of all builderdefs first
Returns:
iterator to a Set of Strings

getLocalizationResource

public static java.util.ResourceBundle getLocalizationResource(java.lang.String builderId)
This will find the correct localization resource to use for this BuilderDef. First it will try BDef.properties Then it will try .BDef.properties

Parameters:
builderId - BuilderDef ID
Returns:
resource, possibly null

getManager

public static BuilderManager getManager()
Get the (singleton) BuilderManager, which will always extend this class.

Returns:
the (singleton) BuilderManager

isBuilderDefAvailable

public boolean isBuilderDefAvailable(java.lang.String builderId,
                                     java.lang.String domainName)
Determines if a BuilderDef is available

Parameters:
builderId - ID of the BuilderDef to check
domain - optional domain name to restrict the check
Returns:
true if the specified BuilderDef is loaded

updateBuilder

public void updateBuilder(BuilderDef builder)
                   throws java.io.IOException
Update the builder record that is cached. This will save the Builder and it will update all the domains to remove it from domains it is no longer in and add it to any new ones. This can also be called on a newly created builder. Note, if the save fails, then the Builder record is NOT updated!!

Throws:
java.io.IOException

updateBuilderFromFile

public void updateBuilderFromFile(java.lang.String filename)
this is used when it is detected that the builder file has changed.

Parameters:
filename -


Copyright © 2009 IBM. All Rights Reserved.