public class DocumentAttributeFactory extends Object
DocumentAttribute instances as well as translation to concrete
instances from a DocumentAttributeContract| Constructor and Description |
|---|
DocumentAttributeFactory() |
| Modifier and Type | Method and Description |
|---|---|
static DocumentAttributeDateTime |
createDateTimeAttribute(String name,
Calendar value)
Constructs a document attribute containing date/time data from the given attribute name and
Calendar
object. |
static DocumentAttributeDateTime |
createDateTimeAttribute(String name,
Date value)
Constructs a document attribute containing date/time data from the given attribute name and
Date object. |
static DocumentAttributeDateTime |
createDateTimeAttribute(String name,
org.joda.time.DateTime value)
Constructs a document attribute containing date/time data from the given attribute name and
DateTime
object. |
static DocumentAttributeDateTime |
createDateTimeAttribute(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 DocumentAttributeDecimal |
createDecimalAttribute(String name,
BigDecimal value)
Constructs a document attribute containing real number data from the given attribute name and
BigDecimal
object. |
static DocumentAttributeDecimal |
createDecimalAttribute(String name,
Number value)
Constructs a document attribute containing real number data from the given attribute name and
Number
object. |
static DocumentAttributeInteger |
createIntegerAttribute(String name,
BigInteger value)
Constructs a document attribute containing integer number data from the given attribute name and
BigInteger object. |
static DocumentAttributeInteger |
createIntegerAttribute(String name,
Number value)
Constructs a document attribute containing integer number data from the given attribute name and
Number
object. |
static DocumentAttributeString |
createStringAttribute(String name,
String value)
Constructs a document attribute containing character data from the given attribute name and
String value. |
static DocumentAttribute.AbstractBuilder<?> |
loadContractIntoBuilder(DocumentAttributeContract contract)
Loads the given
DocumentAttributeContract into the appropriate builder instance based on the type of the
given contract implementation. |
public DocumentAttributeFactory()
public static DocumentAttributeString createStringAttribute(String name, String value)
String value.name - the name of the attribute to construct, must not be a null or blank valuevalue - the value of the attribute as a StringDocumentAttributeString representing the document attributeIllegalArgumentException - if name is a null or blank valuepublic static DocumentAttributeDateTime createDateTimeAttribute(String name, org.joda.time.DateTime value)
DateTime
object.name - the name of the attribute to construct, must not be a null or blank valuevalue - the value of the attribute as a DateTimeDocumentAttributeDateTime representing the document attributeIllegalArgumentException - if name is a null or blank valuepublic static DocumentAttributeDateTime createDateTimeAttribute(String name, Date value)
Date object.name - the name of the attribute to construct, must not be a null or blank valuevalue - the value of the attribute as a DateDocumentAttributeDateTime representing the document attributeIllegalArgumentException - if name is a null or blank valuepublic static DocumentAttributeDateTime createDateTimeAttribute(String name, long instant)
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:00ZDocumentAttributeDateTime representing the document attributeIllegalArgumentException - if name is a null or blank valuepublic static DocumentAttributeDateTime createDateTimeAttribute(String name, Calendar value)
Calendar
object.name - the name of the attribute to construct, must not be a null or blank valuevalue - the value of the attribute as a CalendarDocumentAttributeDateTime representing the document attributeIllegalArgumentException - if name is a null or blank valuepublic static DocumentAttributeDecimal createDecimalAttribute(String name, BigDecimal value)
BigDecimal
object.name - the name of the attribute to construct, must not be a null or blank valuevalue - the value of the attribute as a BigDecimalDocumentAttributeDecimal representing the document attributeIllegalArgumentException - if name is a null or blank valuepublic static DocumentAttributeDecimal createDecimalAttribute(String name, Number value)
Number
object. The given number is first translated to a BigDecimal using Number.doubleValue().name - the name of the attribute to construct, must not be a null or blank valuevalue - the value of the attribute as a NumberDocumentAttributeDecimal representing the document attributeIllegalArgumentException - if name is a null or blank valuepublic static DocumentAttributeInteger createIntegerAttribute(String name, BigInteger value)
BigInteger object.name - the name of the attribute to construct, must not be a null or blank valuevalue - the value of the attribute as a BigIntegerDocumentAttributeInteger representing the document attributeIllegalArgumentException - if name is a null or blank valuepublic static DocumentAttributeInteger createIntegerAttribute(String name, Number value)
Number
object. The given number is first translated to a BigInteger using Number.longValue().name - the name of the attribute to construct, must not be a null or blank valuevalue - the value of the attribute as a NumberDocumentAttributeInteger representing the document attributeIllegalArgumentException - if name is a null or blank valuepublic static DocumentAttribute.AbstractBuilder<?> loadContractIntoBuilder(DocumentAttributeContract contract)
DocumentAttributeContract into the appropriate builder instance based on the type of the
given contract implementation.contract - the contract to load into a builderDocumentAttribute.AbstractBuilder which handles instance of the given
contractIllegalArgumentException - if the given contract is nullIllegalArgumentException - if a builder implementation could not be determined into which to load the given
contract implementationCopyright © 2005–2016 The Kuali Foundation. All rights reserved.