Package net.anotheria.asg.generator.meta
Class MetaDocument
- java.lang.Object
-
- net.anotheria.asg.generator.meta.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 Summary
Constructors Constructor Description MetaDocument(java.lang.String aName)Creates a new document with the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLink(MetaLink l)Adds a link to the document.voidaddProperty(MetaProperty p)Adds a property to the document.MetaPropertygetField(java.lang.String name)Returns a field with given name.java.lang.StringgetFullName()getFullName.java.lang.StringgetIdHolderName()Return the name constant for the id holder for this document for cms storage.java.util.List<MetaProperty>getLinks()Returns the links.java.util.List<MetaLink>getLinksToDocument(MetaDocument anotherDocument)Returns all internal links to the given document if any.java.lang.StringgetListConstantValue()getListConstantValue.java.lang.StringgetListName()getListName.java.lang.StringgetMultiple()getMultiple.java.lang.StringgetName()Getter for the fieldname.java.lang.StringgetName(boolean multiple)Getter for the fieldname.MetaModulegetParentModule()Getter for the fieldparentModule.java.util.List<MetaProperty>getProperties()Returns all contained properties.java.lang.StringgetTemporaryVariableName()getTemporaryVariableName.java.lang.StringgetVariableName()Returns the name of the variable to use in generated code for variables of this documents type.booleanisComparable()Returns true if the document contains at list one comparable property or link.booleanisMultilingual()Returns true if at least one of the properties or links are multilingual, false otherwise.voidsetName(java.lang.String string)Setter for the fieldname.voidsetParentModule(MetaModule parentModule)Setter for the fieldparentModule.java.lang.StringtoString()
-
-
-
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- aMetaLinkobject.
-
getName
public java.lang.String getName()
Getter for the field
name.- Returns:
- a
Stringobject.
-
getName
public java.lang.String getName(boolean multiple)
Getter for the field
name.- Parameters:
multiple- a boolean.- Returns:
- a
Stringobject.
-
getProperties
public java.util.List<MetaProperty> getProperties()
Returns all contained properties.- Returns:
- a
Listobject.
-
setName
public void setName(java.lang.String string)
Setter for the field
name.- Parameters:
string- aStringobject.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getListName
public java.lang.String getListName()
getListName.
- Returns:
- a
Stringobject.
-
getListConstantValue
public java.lang.String getListConstantValue()
getListConstantValue.
- Returns:
- a
Stringobject.
-
getMultiple
public java.lang.String getMultiple()
getMultiple.
- Returns:
- a
Stringobject.
-
getTemporaryVariableName
public java.lang.String getTemporaryVariableName()
getTemporaryVariableName.
- Returns:
- a
Stringobject.
-
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
Stringobject.
-
getLinks
public java.util.List<MetaProperty> getLinks()
Returns the links.- Returns:
- a
Listobject.
-
getIdHolderName
public java.lang.String getIdHolderName()
Return the name constant for the id holder for this document for cms storage.- Returns:
- a
Stringobject.
-
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
MetaPropertyobject.
-
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
Stringobject.
-
getParentModule
public MetaModule getParentModule()
Getter for the field
parentModule.- Returns:
- a
MetaModuleobject.
-
setParentModule
public void setParentModule(MetaModule parentModule)
Setter for the field
parentModule.- Parameters:
parentModule- aMetaModuleobject.
-
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.
-
-