Class GeneratorDataRegistry


  • public final class GeneratorDataRegistry
    extends java.lang.Object
    Used by the generator to store the parsed xml data during the generation.
    Version:
    $Id: $Id
    Author:
    lrosenberg
    • 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 - a MetaDocument object.
        Returns:
        a List object.
      • 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 - a String object.
        rule - a String object.
        Returns:
        a MetaDecorator object.
      • 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 - a String object.
        fieldName - a String object.
        Returns:
        a MetaFilter object.
      • 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.