Class Group

java.lang.Object
org.apache.fulcrum.intake.model.Group
All Implemented Interfaces:
Serializable, org.apache.avalon.framework.logger.LogEnabled

public class Group extends Object implements Serializable, org.apache.avalon.framework.logger.LogEnabled
Holds a group of Fields
Version:
$Id$
Author:
John McNally, Henning P. Schmiedehausen, Quinton McCombs
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterUnmarshal(jakarta.xml.bind.Unmarshaller um, Object parent)
    JAXB / Jakarta callback to set the parent object
    void
    A xhtml valid hidden input field that notifies intake of the group's presence.
    void
    enableLogging(org.apache.avalon.framework.logger.Logger logger)
    Enable Avalon Logging
    get(String fieldName)
    Get the Field
    Get the parent AppData for this group
    Default object to map this group to.
    Gets a list of the names of the fields stored in this object.
    Get the list of Fields.
    Get the part of the key used to specify the group.
    A xhtml valid hidden input field that notifies intake of the group's presence.
    Return the name given to this group.
    Concatenation of gid and oid.
    getObjects(org.apache.fulcrum.parser.ValueParser pp)
    Describe getObjects method here.
    Get the part of the key that distinguishes a group from others of the same name.
    int
    Get the number of Group objects that will be pooled.
    void
    Calls getter methods on objects that are known to Intake so that field values in forms can be initialized from the values contained in the intake tool.
    init(String key, org.apache.fulcrum.parser.ValueParser pp)
    Initializes the Group with parameters from RunData corresponding to key.
    Initializes the group with properties from an object.
    init(org.apache.fulcrum.parser.ValueParser pp)
    Initializes the default Group using parameters.
    boolean
    Performs an AND between all the fields in this group.
    void
    Removes references to this group and its fields from the query parameters
    void
    To be used in the event this group is used within multiple forms within the same template.
    protected void
    setFields(List<Field<?>> inputFields)
    Set a collection of fields for this group
    void
    Calls a setter methods on obj, for fields which have been set.
    void
    Calls a setter methods on obj, for fields which pass validity tests.
    Creates a string representation of this input group.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • Group

      public Group()
      Default constructor
  • Method Details

    • enableLogging

      public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
      Enable Avalon Logging
      Specified by:
      enableLogging in interface org.apache.avalon.framework.logger.LogEnabled
    • init

      public Group init(org.apache.fulcrum.parser.ValueParser pp) throws IntakeException
      Initializes the default Group using parameters.
      Parameters:
      pp - a ValueParser value
      Returns:
      this Group
      Throws:
      IntakeException - if at least one field could not be initialized
    • init

      public Group init(String key, org.apache.fulcrum.parser.ValueParser pp) throws IntakeException
      Initializes the Group with parameters from RunData corresponding to key.
      Parameters:
      key - the group id
      pp - a ValueParser value
      Returns:
      this Group
      Throws:
      IntakeException - if at least one field could not be initialized
    • init

      public Group init(Retrievable obj)
      Initializes the group with properties from an object.
      Parameters:
      obj - a Persistent value
      Returns:
      a Group value
    • getFieldNames

      public String[] getFieldNames()
      Gets a list of the names of the fields stored in this object.
      Returns:
      A String array containing the list of names.
    • getIntakeGroupName

      public String getIntakeGroupName()
      Return the name given to this group. The long name is to avoid conflicts with the get(String key) method.
      Returns:
      a String value
    • getPoolCapacity

      public int getPoolCapacity()
      Get the number of Group objects that will be pooled.
      Returns:
      an int value
    • getGID

      public String getGID()
      Get the part of the key used to specify the group. This is specified in the key attribute in the xml file.
      Returns:
      a String value
    • getOID

      public String getOID()
      Get the part of the key that distinguishes a group from others of the same name.
      Returns:
      a String value
    • getObjectKey

      public String getObjectKey()
      Concatenation of gid and oid.
      Returns:
      a String value
    • getDefaultMapToObject

      public String getDefaultMapToObject()
      Default object to map this group to.
      Returns:
      a String value
    • getObjects

      public List<Group> getObjects(org.apache.fulcrum.parser.ValueParser pp) throws IntakeException
      Describe getObjects method here.
      Parameters:
      pp - a ValueParser value
      Returns:
      an ArrayList value
      Throws:
      IntakeException - if an error occurs
    • get

      public Field<?> get(String fieldName) throws IntakeException
      Get the Field
      Parameters:
      fieldName - the name of the field
      Returns:
      the named field
      Throws:
      IntakeException - indicates the field could not be found.
    • getFields

      public List<Field<?>> getFields()
      Get the list of Fields.
      Returns:
      list of Fields
    • setFields

      protected void setFields(List<Field<?>> inputFields)
      Set a collection of fields for this group
      Parameters:
      inputFields - the fields to set
    • isAllValid

      public boolean isAllValid()
      Performs an AND between all the fields in this group.
      Returns:
      a boolean value
    • setProperties

      public void setProperties(Object obj) throws IntakeException
      Calls a setter methods on obj, for fields which have been set.
      Parameters:
      obj - Object to be set with the values from the group.
      Throws:
      IntakeException - indicates that a failure occurred while executing the setter methods of the mapped object.
    • setValidProperties

      public void setValidProperties(Object obj)
      Calls a setter methods on obj, for fields which pass validity tests. In most cases one should call Intake.isAllValid() and then if that test passes call setProperties. Use this method when some data is known to be invalid, but you still want to set the object properties that are valid.
      Parameters:
      obj - the object to set the properties for
    • getProperties

      public void getProperties(Object obj) throws IntakeException
      Calls getter methods on objects that are known to Intake so that field values in forms can be initialized from the values contained in the intake tool.
      Parameters:
      obj - Object that will be used to as a source of data for setting the values of the fields within the group.
      Throws:
      IntakeException - indicates that a failure occurred while executing the setter methods of the mapped object.
    • removeFromRequest

      public void removeFromRequest()
      Removes references to this group and its fields from the query parameters
    • resetDeclared

      public void resetDeclared()
      To be used in the event this group is used within multiple forms within the same template.
    • getHtmlFormInput

      public String getHtmlFormInput()
      A xhtml valid hidden input field that notifies intake of the group's presence.
      Returns:
      a String value
    • appendHtmlFormInput

      public void appendHtmlFormInput(StringBuilder sb)
      A xhtml valid hidden input field that notifies intake of the group's presence.
      Parameters:
      sb - the string builder to append the HTML to
    • toString

      public String toString()
      Creates a string representation of this input group. This is an xml representation.
      Overrides:
      toString in class Object
    • getAppData

      public AppData getAppData()
      Get the parent AppData for this group
      Returns:
      the parent
    • afterUnmarshal

      public void afterUnmarshal(jakarta.xml.bind.Unmarshaller um, Object parent)
      JAXB / Jakarta callback to set the parent object
      Parameters:
      um - the Unmarshaller
      parent - the parent object (an AppData object)