Package net.anotheria.asg.generator
Class GeneratorDataRegistry
- java.lang.Object
-
- net.anotheria.asg.generator.GeneratorDataRegistry
-
public final class GeneratorDataRegistry extends java.lang.ObjectUsed by the generator to store the parsed xml data during the generation.- Version:
- $Id: $Id
- Author:
- lrosenberg
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDecorator(MetaDecorator decorator)Adds the decorator to the storage.voidaddDecorators(java.util.List<MetaDecorator> someDecorators)Adds some decorators to the storage.voidaddFilter(MetaFilter filter)Adds parsed filter.voidaddFilters(java.util.List<MetaFilter> aFilters)Adds parsed filters.voidaddModule(MetaModule m)Adds a new parsed module to the storage.voidaddModules(java.util.List<MetaModule> aModules)Adds some modules to the storage.voidaddType(DataType type)Adds parsed data type.voidaddTypes(java.util.List<DataType> aTypes)Adds parsed data types.voidaddValidator(MetaValidator validator)Adds parsed validator.voidaddValidators(java.util.List<MetaValidator> aValidators)Adds parsed validators.voidaddView(MetaView v)Adds a view to the storage.voidaddViews(java.util.List<MetaView> aViews)Adds some view to the storage.MetaDecoratorcreateDecorator(java.lang.String name, java.lang.String rule)createDecorator.MetaFiltercreateFilter(java.lang.String name, java.lang.String fieldName)createFilter.java.util.List<DirectLink>findLinksToDocument(MetaDocument target)findLinksToDocument.MetaSectionfindViewSection(MetaDocument document)findViewSection.ContextgetContext()Getter for the fieldcontext.MetaDecoratorgetDecorator(java.lang.String name)Returns parsed decorator by name.MetaFiltergetFilter(java.lang.String name)returns parsed filter by name.static GeneratorDataRegistrygetInstance()Returns the singleton instance of the GeneratorDataRegistry.MetaModulegetModule(java.lang.String name)Returns the module from the storage.java.util.Collection<MetaModule>getModules()Returns module from storage.GenerationOptionsgetOptions()Getter for the fieldoptions.DataTypegetType(java.lang.String name)Returns parsed data type by name.MetaValidatorgetValidator(java.lang.String name)Returns parsed validator by name.MetaViewgetView(java.lang.String name)Return view from storage.static booleanhasLanguageCopyMethods(MetaDocument doc)Returns true if the document should have methods for language copying.MetaDocumentresolveLink(java.lang.String link)resolveLink.voidsetContext(Context context)Sets the context.voidsetOptions(GenerationOptions options)Setter for the fieldoptions.
-
-
-
Method Detail
-
getInstance
public static GeneratorDataRegistry getInstance()
Returns the singleton instance of the GeneratorDataRegistry.- Returns:
- instance of the GeneratorDataRegistry
-
addModule
public void addModule(MetaModule m)
Adds a new parsed module to the storage.- Parameters:
m- the module to add.
-
addModules
public void addModules(java.util.List<MetaModule> aModules)
Adds some modules to the storage.- Parameters:
aModules- a list of modules to add.
-
addView
public void addView(MetaView v)
Adds a view to the storage.- Parameters:
v- the view to add.
-
addViews
public void addViews(java.util.List<MetaView> aViews)
Adds some view to the storage.- Parameters:
aViews- the views to add.
-
resolveLink
public MetaDocument resolveLink(java.lang.String link)
resolveLink.
- Parameters:
link- link for resolving document- Returns:
- resolved document
-
findLinksToDocument
public java.util.List<DirectLink> findLinksToDocument(MetaDocument target)
findLinksToDocument.
- Parameters:
target- aMetaDocumentobject.- Returns:
- a
Listobject.
-
findViewSection
public MetaSection findViewSection(MetaDocument document)
findViewSection.
- Parameters:
document- aMetaDocumentobject.- Returns:
- a
MetaSectionobject.
-
getModule
public MetaModule getModule(java.lang.String name)
Returns the module from the storage.- Parameters:
name- the name of the module.- Returns:
- module
-
getModules
public java.util.Collection<MetaModule> getModules()
Returns module from storage.- Returns:
- modules
-
getView
public MetaView getView(java.lang.String name)
Return view from storage.- Parameters:
name- name of view- Returns:
- view
-
getContext
public Context getContext()
Getter for the field
context.- Returns:
- the context
-
setContext
public void setContext(Context context)
Sets the context.- Parameters:
context- context to set
-
addType
public void addType(DataType type)
Adds parsed data type.- Parameters:
type- type to add
-
addTypes
public void addTypes(java.util.List<DataType> aTypes)
Adds parsed data types.- Parameters:
aTypes- types to add
-
getType
public DataType getType(java.lang.String name)
Returns parsed data type by name.- Parameters:
name- name of type- Returns:
- type
-
addDecorator
public void addDecorator(MetaDecorator decorator)
Adds the decorator to the storage.- Parameters:
decorator- the decorator to add.
-
addDecorators
public void addDecorators(java.util.List<MetaDecorator> someDecorators)
Adds some decorators to the storage.- Parameters:
someDecorators- a list with decorators to add.
-
getDecorator
public MetaDecorator getDecorator(java.lang.String name)
Returns parsed decorator by name.- Parameters:
name- name of decorator- Returns:
- decorator
-
createDecorator
public MetaDecorator createDecorator(java.lang.String name, java.lang.String rule)
createDecorator.
- Parameters:
name- aStringobject.rule- aStringobject.- Returns:
- a
MetaDecoratorobject.
-
addFilter
public void addFilter(MetaFilter filter)
Adds parsed filter.- Parameters:
filter- filter to add
-
addFilters
public void addFilters(java.util.List<MetaFilter> aFilters)
Adds parsed filters.- Parameters:
aFilters- filters to add
-
getFilter
public MetaFilter getFilter(java.lang.String name)
returns parsed filter by name.- Parameters:
name- name of filter- Returns:
- filter
-
createFilter
public MetaFilter createFilter(java.lang.String name, java.lang.String fieldName)
createFilter.
- Parameters:
name- aStringobject.fieldName- aStringobject.- Returns:
- a
MetaFilterobject.
-
addValidator
public void addValidator(MetaValidator validator)
Adds parsed validator.- Parameters:
validator- validator to add
-
addValidators
public void addValidators(java.util.List<MetaValidator> aValidators)
Adds parsed validators.- Parameters:
aValidators- validators to add
-
getValidator
public MetaValidator getValidator(java.lang.String name)
Returns parsed validator by name.- Parameters:
name- validator name- Returns:
- validator
-
hasLanguageCopyMethods
public static boolean hasLanguageCopyMethods(MetaDocument doc)
Returns true if the document should have methods for language copying.- Parameters:
doc- the document to check.- Returns:
- true if support for languages is enabled and the document has multilingual attributes.
-
getOptions
public GenerationOptions getOptions()
Getter for the field
options.- Returns:
- a
GenerationOptionsobject.
-
setOptions
public void setOptions(GenerationOptions options)
Setter for the field
options.- Parameters:
options- aGenerationOptionsobject.
-
-