Package org.apache.fulcrum.intake.model
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 -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterUnmarshal
(jakarta.xml.bind.Unmarshaller um, Object parent) JAXB / Jakarta callback to set the parent objectvoid
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 LoggingField
<?> Get the FieldGet the parent AppData for this groupDefault object to map this group to.String[]
Gets a list of the names of the fields stored in this object.Get the list of Fields.getGID()
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) DescribegetObjects
method here.getOID()
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
getProperties
(Object obj) 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.Initializes the Group with parameters from RunData corresponding to key.init
(Retrievable obj) 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 parametersvoid
To be used in the event this group is used within multiple forms within the same template.protected void
Set a collection of fields for this groupvoid
setProperties
(Object obj) Calls a setter methods on obj, for fields which have been set.void
setValidProperties
(Object obj) Calls a setter methods on obj, for fields which pass validity tests.toString()
Creates a string representation of this input group.
-
Field Details
-
EMPTY
- See Also:
-
NEW
- See Also:
-
-
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 interfaceorg.apache.avalon.framework.logger.LogEnabled
-
init
Initializes the default Group using parameters.- Parameters:
pp
- aValueParser
value- Returns:
- this Group
- Throws:
IntakeException
- if at least one field could not be initialized
-
init
Initializes the Group with parameters from RunData corresponding to key.- Parameters:
key
- the group idpp
- aValueParser
value- Returns:
- this Group
- Throws:
IntakeException
- if at least one field could not be initialized
-
init
Initializes the group with properties from an object.- Parameters:
obj
- aPersistent
value- Returns:
- a
Group
value
-
getFieldNames
Gets a list of the names of the fields stored in this object.- Returns:
- A String array containing the list of names.
-
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
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
Get the part of the key that distinguishes a group from others of the same name.- Returns:
- a
String
value
-
getObjectKey
Concatenation of gid and oid.- Returns:
- a
String
value
-
getDefaultMapToObject
Default object to map this group to.- Returns:
- a
String
value
-
getObjects
DescribegetObjects
method here.- Parameters:
pp
- aValueParser
value- Returns:
- an
ArrayList
value - Throws:
IntakeException
- if an error occurs
-
get
Get the Field- Parameters:
fieldName
- the name of the field- Returns:
- the named field
- Throws:
IntakeException
- indicates the field could not be found.
-
getFields
Get the list of Fields.- Returns:
- list of Fields
-
setFields
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
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
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
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
A xhtml valid hidden input field that notifies intake of the group's presence.- Returns:
- a
String
value
-
appendHtmlFormInput
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
Creates a string representation of this input group. This is an xml representation. -
getAppData
Get the parent AppData for this group- Returns:
- the parent
-
afterUnmarshal
JAXB / Jakarta callback to set the parent object- Parameters:
um
- the Unmarshallerparent
- the parent object (an AppData object)
-