Class Helper

java.lang.Object
org.codehaus.modello.plugin.velocity.Helper

public class Helper extends Object
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 Details

    • Helper

      public Helper(Version version)
  • Method Details

    • capitalise

      public String capitalise(String str)
      Returns the capitalised version of the given string.
    • uncapitalise

      public String uncapitalise(String str)
      Returns the uncapitalised version of the given string.
    • singular

      public String singular(String str)
      Returns the singular name for the given string.
    • ancestors

      public List<ModelClass> ancestors(ModelClass clazz)
      Returns the list of ancestors for the given ModelClass.
    • xmlClassMetadata

      public XmlClassMetadata xmlClassMetadata(ModelClass clazz)
      Returns the XmlClassMetadata for the given ModelClass.
    • xmlFieldMetadata

      public XmlFieldMetadata xmlFieldMetadata(ModelField field)
      Returns the XmlFieldMetadata for the given ModelField.
    • xmAssociationMetadata

      public XmlAssociationMetadata xmAssociationMetadata(ModelField field)
      Returns the XmlAssociationMetadata for the given ModelField.
    • isFlatItems

      public boolean isFlatItems(ModelField field)
      Checks if the given ModelField is a flat item.
    • xmlFields

      public List<ModelField> xmlFields(ModelClass modelClass)
      Returns a list of all ModelField for a given ModelClass. The list will contain all fields defined on the class and on its parents, excluding any field flagged as being xml transient.