Class DocumentAttributeFactory
java.lang.Object
org.kuali.rice.kew.api.document.attribute.DocumentAttributeFactory
A factory that helps with creation of new
DocumentAttribute instances as well as translation to concrete
instances from a DocumentAttributeContract- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentAttributeDateTimecreateDateTimeAttribute(String name, long instant) Constructs a document attribute containing date/time data from the given attribute name and a numeric long representing the number of milliseconds from 1970-01-01T00:00:00Z in the default time zone.static DocumentAttributeDateTimecreateDateTimeAttribute(String name, Calendar value) Constructs a document attribute containing date/time data from the given attribute name andCalendarobject.static DocumentAttributeDateTimecreateDateTimeAttribute(String name, Date value) Constructs a document attribute containing date/time data from the given attribute name andDateobject.static DocumentAttributeDateTimecreateDateTimeAttribute(String name, org.joda.time.DateTime value) Constructs a document attribute containing date/time data from the given attribute name andDateTimeobject.static DocumentAttributeDecimalcreateDecimalAttribute(String name, Number value) Constructs a document attribute containing real number data from the given attribute name andNumberobject.static DocumentAttributeDecimalcreateDecimalAttribute(String name, BigDecimal value) Constructs a document attribute containing real number data from the given attribute name andBigDecimalobject.static DocumentAttributeIntegercreateIntegerAttribute(String name, Number value) Constructs a document attribute containing integer number data from the given attribute name andNumberobject.static DocumentAttributeIntegercreateIntegerAttribute(String name, BigInteger value) Constructs a document attribute containing integer number data from the given attribute name andBigIntegerobject.static DocumentAttributeStringcreateStringAttribute(String name, String value) Constructs a document attribute containing character data from the given attribute name andStringvalue.static DocumentAttribute.AbstractBuilder<?> Loads the givenDocumentAttributeContractinto the appropriate builder instance based on the type of the given contract implementation.
-
Constructor Details
-
DocumentAttributeFactory
public DocumentAttributeFactory()
-
-
Method Details
-
createStringAttribute
Constructs a document attribute containing character data from the given attribute name andStringvalue.- Parameters:
name- the name of the attribute to construct, must not be a null or blank valuevalue- the value of the attribute as aString- Returns:
- a constructed
DocumentAttributeStringrepresenting the document attribute - Throws:
IllegalArgumentException- if name is a null or blank value
-
createDateTimeAttribute
public static DocumentAttributeDateTime createDateTimeAttribute(String name, org.joda.time.DateTime value) Constructs a document attribute containing date/time data from the given attribute name andDateTimeobject.- Parameters:
name- the name of the attribute to construct, must not be a null or blank valuevalue- the value of the attribute as aDateTime- Returns:
- a constructed
DocumentAttributeDateTimerepresenting the document attribute - Throws:
IllegalArgumentException- if name is a null or blank value
-
createDateTimeAttribute
Constructs a document attribute containing date/time data from the given attribute name andDateobject.- Parameters:
name- the name of the attribute to construct, must not be a null or blank valuevalue- the value of the attribute as aDate- Returns:
- a constructed
DocumentAttributeDateTimerepresenting the document attribute - Throws:
IllegalArgumentException- if name is a null or blank value
-
createDateTimeAttribute
Constructs a document attribute containing date/time data from the given attribute name and a numeric long representing the number of milliseconds from 1970-01-01T00:00:00Z in the default time zone.- Parameters:
name- the name of the attribute to construct, must not be a null or blank valueinstant- the instant value represented as milliseconds from 1970-01-01T00:00:00Z- Returns:
- a constructed
DocumentAttributeDateTimerepresenting the document attribute - Throws:
IllegalArgumentException- if name is a null or blank value
-
createDateTimeAttribute
Constructs a document attribute containing date/time data from the given attribute name andCalendarobject.- Parameters:
name- the name of the attribute to construct, must not be a null or blank valuevalue- the value of the attribute as aCalendar- Returns:
- a constructed
DocumentAttributeDateTimerepresenting the document attribute - Throws:
IllegalArgumentException- if name is a null or blank value
-
createDecimalAttribute
Constructs a document attribute containing real number data from the given attribute name andBigDecimalobject.- Parameters:
name- the name of the attribute to construct, must not be a null or blank valuevalue- the value of the attribute as aBigDecimal- Returns:
- a constructed
DocumentAttributeDecimalrepresenting the document attribute - Throws:
IllegalArgumentException- if name is a null or blank value
-
createDecimalAttribute
Constructs a document attribute containing real number data from the given attribute name andNumberobject. The given number is first translated to aBigDecimalusingNumber.doubleValue().- Parameters:
name- the name of the attribute to construct, must not be a null or blank valuevalue- the value of the attribute as aNumber- Returns:
- a constructed
DocumentAttributeDecimalrepresenting the document attribute - Throws:
IllegalArgumentException- if name is a null or blank value
-
createIntegerAttribute
Constructs a document attribute containing integer number data from the given attribute name andBigIntegerobject.- Parameters:
name- the name of the attribute to construct, must not be a null or blank valuevalue- the value of the attribute as aBigInteger- Returns:
- a constructed
DocumentAttributeIntegerrepresenting the document attribute - Throws:
IllegalArgumentException- if name is a null or blank value
-
createIntegerAttribute
Constructs a document attribute containing integer number data from the given attribute name andNumberobject. The given number is first translated to aBigIntegerusingNumber.longValue().- Parameters:
name- the name of the attribute to construct, must not be a null or blank valuevalue- the value of the attribute as aNumber- Returns:
- a constructed
DocumentAttributeIntegerrepresenting the document attribute - Throws:
IllegalArgumentException- if name is a null or blank value
-
loadContractIntoBuilder
public static DocumentAttribute.AbstractBuilder<?> loadContractIntoBuilder(DocumentAttributeContract contract) Loads the givenDocumentAttributeContractinto the appropriate builder instance based on the type of the given contract implementation.- Parameters:
contract- the contract to load into a builder- Returns:
- an implementation of
DocumentAttribute.AbstractBuilderwhich handles instance of the given contract - Throws:
IllegalArgumentException- if the given contract is nullIllegalArgumentException- if a builder implementation could not be determined into which to load the given contract implementation
-