Class MetaDocument

  • All Implemented Interfaces:
    IGenerateable

    public class MetaDocument
    extends java.lang.Object
    implements IGenerateable
    Internal representation of a document.
    Version:
    $Id: $Id
    Author:
    another
    • Constructor Detail

      • MetaDocument

        public MetaDocument​(java.lang.String aName)
        Creates a new document with the given name.
        Parameters:
        aName - a String object.
    • Method Detail

      • addProperty

        public void addProperty​(MetaProperty p)
        Adds a property to the document.
        Parameters:
        p - property to add.
      • addLink

        public void addLink​(MetaLink l)
        Adds a link to the document.
        Parameters:
        l - a MetaLink object.
      • getName

        public java.lang.String getName()

        Getter for the field name.

        Returns:
        a String object.
      • getName

        public java.lang.String getName​(boolean multiple)

        Getter for the field name.

        Parameters:
        multiple - a boolean.
        Returns:
        a String object.
      • getProperties

        public java.util.List<MetaProperty> getProperties()
        Returns all contained properties.
        Returns:
        a List object.
      • setName

        public void setName​(java.lang.String string)

        Setter for the field name.

        Parameters:
        string - a String object.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getListName

        public java.lang.String getListName()

        getListName.

        Returns:
        a String object.
      • getListConstantValue

        public java.lang.String getListConstantValue()

        getListConstantValue.

        Returns:
        a String object.
      • getMultiple

        public java.lang.String getMultiple()

        getMultiple.

        Returns:
        a String object.
      • getTemporaryVariableName

        public java.lang.String getTemporaryVariableName()

        getTemporaryVariableName.

        Returns:
        a String object.
      • getVariableName

        public java.lang.String getVariableName()
        Returns the name of the variable to use in generated code for variables of this documents type.
        Returns:
        a String object.
      • getLinks

        public java.util.List<MetaProperty> getLinks()
        Returns the links.
        Returns:
        a List object.
      • getIdHolderName

        public java.lang.String getIdHolderName()
        Return the name constant for the id holder for this document for cms storage.
        Returns:
        a String object.
      • getField

        public MetaProperty getField​(java.lang.String name)
        Returns a field with given name. This can be a virtual field for the presentation (id, plainId, documentLastUpdateTimestamp, multilingualInstanceDisabled), a MetaProperty or a MetaLink. If nothing is found an IllegalArgumentException is thrown.
        Parameters:
        name - name of the field.
        Returns:
        a MetaProperty object.
      • isComparable

        public boolean isComparable()
        Returns true if the document contains at list one comparable property or link. TODO (leon) I have serious doubts whether this method does what its intended to do.
        Returns:
        a boolean.
      • getFullName

        public java.lang.String getFullName()

        getFullName.

        Returns:
        a String object.
      • getParentModule

        public MetaModule getParentModule()

        Getter for the field parentModule.

        Returns:
        a MetaModule object.
      • setParentModule

        public void setParentModule​(MetaModule parentModule)

        Setter for the field parentModule.

        Parameters:
        parentModule - a MetaModule object.
      • getLinksToDocument

        public java.util.List<MetaLink> getLinksToDocument​(MetaDocument anotherDocument)
        Returns all internal links to the given document if any. This is useful if you need to find out at generation time whether one document is linked to another document.
        Parameters:
        anotherDocument - the target document.
        Returns:
        list of MetaLinks to the targetDocument or an empty list.
      • isMultilingual

        public boolean isMultilingual()
        Returns true if at least one of the properties or links are multilingual, false otherwise.
        Returns:
        a boolean.