Class Helper
java.lang.Object
org.codehaus.modello.plugin.velocity.Helper
Helper class to use inside velocity templates.
This will be made available using ${Helper}
inside the template.
For example, the following line will return the list of ancestors for a given modello class:
#set ( $ancestors = $Helper.ancestors( $class ) )
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList
<org.codehaus.modello.model.ModelClass> ancestors
(org.codehaus.modello.model.ModelClass clazz) Returns the list of ancestors for the givenModelClass
.capitalise
(String str) Returns the capitalised version of the given string.boolean
isFlatItems
(org.codehaus.modello.model.ModelField field) Checks if the givenModelField
is a flat item.Returns the singular name for the given string.uncapitalise
(String str) Returns the uncapitalised version of the given string.org.codehaus.modello.plugins.xml.metadata.XmlAssociationMetadata
xmAssociationMetadata
(org.codehaus.modello.model.ModelField field) Returns theXmlAssociationMetadata
for the givenModelField
.org.codehaus.modello.plugins.xml.metadata.XmlClassMetadata
xmlClassMetadata
(org.codehaus.modello.model.ModelClass clazz) Returns theXmlClassMetadata
for the givenModelClass
.org.codehaus.modello.plugins.xml.metadata.XmlFieldMetadata
xmlFieldMetadata
(org.codehaus.modello.model.ModelField field) Returns theXmlFieldMetadata
for the givenModelField
.List
<org.codehaus.modello.model.ModelField> xmlFields
(org.codehaus.modello.model.ModelClass modelClass) Returns a list of allModelField
for a givenModelClass
.
-
Constructor Details
-
Helper
public Helper(org.codehaus.modello.model.Version version)
-
-
Method Details
-
capitalise
Returns the capitalised version of the given string. -
uncapitalise
Returns the uncapitalised version of the given string. -
singular
Returns the singular name for the given string. -
ancestors
public List<org.codehaus.modello.model.ModelClass> ancestors(org.codehaus.modello.model.ModelClass clazz) Returns the list of ancestors for the givenModelClass
. -
xmlClassMetadata
public org.codehaus.modello.plugins.xml.metadata.XmlClassMetadata xmlClassMetadata(org.codehaus.modello.model.ModelClass clazz) Returns theXmlClassMetadata
for the givenModelClass
. -
xmlFieldMetadata
public org.codehaus.modello.plugins.xml.metadata.XmlFieldMetadata xmlFieldMetadata(org.codehaus.modello.model.ModelField field) Returns theXmlFieldMetadata
for the givenModelField
. -
xmAssociationMetadata
public org.codehaus.modello.plugins.xml.metadata.XmlAssociationMetadata xmAssociationMetadata(org.codehaus.modello.model.ModelField field) Returns theXmlAssociationMetadata
for the givenModelField
. -
isFlatItems
public boolean isFlatItems(org.codehaus.modello.model.ModelField field) Checks if the givenModelField
is a flat item. -
xmlFields
public List<org.codehaus.modello.model.ModelField> xmlFields(org.codehaus.modello.model.ModelClass modelClass) Returns a list of allModelField
for a givenModelClass
. The list will contain all fields defined on the class and on its parents, excluding any field flagged as being xml transient.
-