Class Helper


  • public class Helper
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      Helper​(org.codehaus.modello.model.Version version)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<org.codehaus.modello.model.ModelClass> ancestors​(org.codehaus.modello.model.ModelClass clazz)
      Returns the list of ancestors for the given ModelClass.
      java.lang.String capitalise​(java.lang.String str)
      Returns the capitalised version of the given string.
      boolean isFlatItems​(org.codehaus.modello.model.ModelField field)
      Checks if the given ModelField is a flat item.
      java.lang.String singular​(java.lang.String str)
      Returns the singular name for the given string.
      java.lang.String uncapitalise​(java.lang.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 the XmlAssociationMetadata for the given ModelField.
      org.codehaus.modello.plugins.xml.metadata.XmlClassMetadata xmlClassMetadata​(org.codehaus.modello.model.ModelClass clazz)
      Returns the XmlClassMetadata for the given ModelClass.
      org.codehaus.modello.plugins.xml.metadata.XmlFieldMetadata xmlFieldMetadata​(org.codehaus.modello.model.ModelField field)
      Returns the XmlFieldMetadata for the given ModelField.
      java.util.List<org.codehaus.modello.model.ModelField> xmlFields​(org.codehaus.modello.model.ModelClass modelClass)
      Returns a list of all ModelField for a given ModelClass.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Helper

        public Helper​(org.codehaus.modello.model.Version version)
    • Method Detail

      • capitalise

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

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

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

        public java.util.List<org.codehaus.modello.model.ModelClass> ancestors​(org.codehaus.modello.model.ModelClass clazz)
        Returns the list of ancestors for the given ModelClass.
      • xmlClassMetadata

        public org.codehaus.modello.plugins.xml.metadata.XmlClassMetadata xmlClassMetadata​(org.codehaus.modello.model.ModelClass clazz)
        Returns the XmlClassMetadata for the given ModelClass.
      • xmlFieldMetadata

        public org.codehaus.modello.plugins.xml.metadata.XmlFieldMetadata xmlFieldMetadata​(org.codehaus.modello.model.ModelField field)
        Returns the XmlFieldMetadata for the given ModelField.
      • xmAssociationMetadata

        public org.codehaus.modello.plugins.xml.metadata.XmlAssociationMetadata xmAssociationMetadata​(org.codehaus.modello.model.ModelField field)
        Returns the XmlAssociationMetadata for the given ModelField.
      • isFlatItems

        public boolean isFlatItems​(org.codehaus.modello.model.ModelField field)
        Checks if the given ModelField is a flat item.
      • xmlFields

        public java.util.List<org.codehaus.modello.model.ModelField> xmlFields​(org.codehaus.modello.model.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.