public final class Attribute
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DDBB_DECIMALPATTERN
Formatters for reading, importing, exporting and storing BigDecimal
|
static java.lang.String |
DECIMALPATTERN
Formatters for reading, importing, exporting and storing BigDecimal
|
static java.math.BigDecimal |
MINIMUMBD |
static java.lang.String |
StringListSeparator
Separator when exporting and importing multiple values of an Attribute
|
static int |
tBOOLEAN
Constant for Type Boolean
|
static int |
tDATE
Constant for Type Date
|
static int |
tFLOAT
Constant for Type "float" (BigDecimal actually for portability)
|
static int |
tINTEGER
Constant for Type Integer
|
static int |
tMAX
Maximum value of types
|
static int |
tMIN
Minimum value of types
|
static int |
tSTRING
Constant for Type String
|
static int |
tTHES
Constant for Type reference to a Thesaurus Term
|
static int |
tTIMESTAMP
Constant for Type TimeStamp
|
Constructor and Description |
---|
Attribute(org.w3c.dom.Node OPDObject)
Constructs an attribute from a XML node.
|
Attribute(java.lang.String pName,
java.lang.String pUserName,
java.lang.String pDescription,
int pType,
boolean pRequired,
java.lang.Object pValue,
int pLongStr,
boolean pPrimKey,
boolean pUnique,
boolean pModifAllowed)
Constructor of an Attribute for MONO valued Attributes
|
Attribute(java.lang.String pName,
java.lang.String pUserName,
java.lang.String pDescription,
int pType,
boolean pRequired,
java.lang.Object pValue,
int pLongStr,
boolean pPrimKey,
boolean pUnique,
boolean pModifAllowed,
boolean pMultivalued)
Default constructor of an Attribute for MONO or MULTI valued Attributes
|
Modifier and Type | Method and Description |
---|---|
boolean |
AddValue(java.lang.Object pValue)
Add a value to the set of values
|
static java.lang.String |
BD2String(java.math.BigDecimal BD)
Converts a BigDecimal to a OPD formatted String
|
static java.lang.String |
BD2StringDDBB(java.math.BigDecimal BD)
Converts a BigDecimal to a OPD formatted String
|
void |
ClearValues()
Clear of the values in multivalued attributes
|
Attribute |
Copy()
Creates a copy of the current Attribute.
|
boolean |
equalDef(Attribute Attr)
Compares if the current Attribute is equals in DEFINITION to the Attribute parameter
|
boolean |
equals(Attribute Attr)
Compares if the current Attribute is equals in all elements (including values an definition) to the Attribute parameter
|
java.lang.String |
Export()
Exports the Attribute value(s) in a fixed format so it can be included in any export process
and imported later (in example to/from an .opd file)
|
java.lang.String |
ExportXML()
Exports the Attribute to XML (for inclusion in .opd file or otherexport processes)
|
java.lang.String |
getDescription() |
int |
getLongStr() |
java.lang.String |
getName() |
int |
getType() |
java.lang.String |
getUserName() |
java.lang.Object |
getValue() |
java.util.TreeSet |
getValuesList() |
void |
Import(java.lang.String Val)
Parses a MULTIPLE or SINGLE String value depending of the Attribute type and ASSIGNS the Value to the object
|
void |
ImportXML(java.lang.String Val)
Parses a MULTIPLE or SINGLE String value depending of the Attribute type and ASSIGNS the Value to the object
The strings will come from an XML, so the can have escaped chars
|
boolean |
isModifAllowed() |
boolean |
isMultivalued() |
boolean |
isPrimKey() |
boolean |
isRequired() |
boolean |
isUnique() |
boolean |
RemoveValue(java.lang.Object pValue)
Remove a value from the set of values
|
void |
setDescription(java.lang.String pDescription) |
void |
setLongStr(int pLongStr) |
void |
setModifAllowed(boolean pModifAllowed) |
void |
setMultivalued(boolean Multivalued) |
void |
setName(java.lang.String pName) |
void |
setPrimKey(boolean PrimKey) |
void |
setRequired(boolean pRequired) |
void |
setType(int pType) |
void |
setUnique(boolean Unique) |
void |
setUserName(java.lang.String pUserName) |
void |
setValue(java.lang.Object pValue) |
static java.math.BigDecimal |
String2BD(java.lang.String SBD)
Evaluates a string in any format with decimals to a DBigDecimal in OPD format
|
static java.math.BigDecimal |
String2BDDDBB(java.lang.String SBD)
Evaluates a string in any format with decimals to a DBigDecimal in OPD format
|
java.lang.String |
ToCSV()
Returns the Value formated for CSV export
|
java.lang.String |
toString()
Overrides default toString method, returning
|
java.lang.String |
toXML()
Converts name and value of the attribute to XML
|
java.lang.String |
toXMLFull()
Converts all the definition of the attribute to XML
|
java.lang.String |
toXMLt()
Converts all the definition of the attribute to XML
|
void |
Verify()
Checks if the current values of the object fullfil the definition
|
public static final int tINTEGER
public static final int tFLOAT
public static final int tSTRING
public static final int tDATE
public static final int tBOOLEAN
public static final int tTIMESTAMP
public static final int tTHES
public static final int tMIN
public static final int tMAX
public static final java.lang.String StringListSeparator
public static final java.lang.String DDBB_DECIMALPATTERN
public static final java.lang.String DECIMALPATTERN
public static final java.math.BigDecimal MINIMUMBD
public Attribute(java.lang.String pName, java.lang.String pUserName, java.lang.String pDescription, int pType, boolean pRequired, java.lang.Object pValue, int pLongStr, boolean pPrimKey, boolean pUnique, boolean pModifAllowed, boolean pMultivalued) throws PDException
pName
- Internal/Technical name used for importing, exporting and table columnspUserName
- Name visible for userpDescription
- Description, used also as toooltip in user interfacepType
- Physical tipe of attribute. One of the internal types tSTRING, tDATE,..pRequired
- Required when creating or modifying any objectpValue
- optional valuepLongStr
- Max length for String, Id Thesaur for tTHES typepPrimKey
- Is primary keypUnique
- Is unique valuepModifAllowed
- Is Allowed to modify after interting elementpMultivalued
- Allows to store many valuesPDException
- In any errorpublic Attribute(java.lang.String pName, java.lang.String pUserName, java.lang.String pDescription, int pType, boolean pRequired, java.lang.Object pValue, int pLongStr, boolean pPrimKey, boolean pUnique, boolean pModifAllowed) throws PDException
pName
- Internal/Technical name used for importing, exporting and table columnspUserName
- Name visible for userpDescription
- Description, used also as toooltip in user interfacepType
- Physical tipe of attribute. One of the internal types tSTRING, tDATE,..pRequired
- Required when creating or modifying any objectpValue
- optional valuepLongStr
- Max length for String, Id Thesaur for tTHES typepPrimKey
- Is primary keypUnique
- Is unique valuepModifAllowed
- Is Allowed to modify after interting elementPDException
- In any errorpublic Attribute(org.w3c.dom.Node OPDObject) throws PDException
OPDObject
- XML Node form org.w3c.domPDException
- in any error in parsing oor valuespublic Attribute Copy()
public boolean equals(Attribute Attr)
Attr
- Attribute to compare withpublic boolean equalDef(Attribute Attr)
Attr
- Attribute to compare definition withpublic java.lang.String getName()
public void setName(java.lang.String pName) throws PDException
pName
- the Name to setPDException
- in any errorpublic java.lang.String getDescription()
public void setDescription(java.lang.String pDescription)
pDescription
- the Description to setpublic int getType()
public void setType(int pType) throws PDException
pType
- the Type to setPDException
- inf the type is not a correct onepublic boolean isRequired()
public void setRequired(boolean pRequired)
pRequired
- the Required to setpublic java.lang.Object getValue()
public void setValue(java.lang.Object pValue) throws PDException
pValue
- the ValuePDException
- if Attribute is multivaluedpublic int getLongStr()
public void setLongStr(int pLongStr) throws PDException
pLongStr
- the LongStr to setPDException
- if parameter is longer that current valuepublic boolean isPrimKey()
public void setPrimKey(boolean PrimKey) throws PDException
PrimKey
- the PrimKey to setPDException
- in any errorpublic boolean isUnique()
public void setUnique(boolean Unique) throws PDException
Unique
- the Unique to setPDException
- if Attribute is multivaluedpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean isModifAllowed()
public void setModifAllowed(boolean pModifAllowed)
pModifAllowed
- the ModifAllowed to setpublic java.lang.String getUserName()
public void setUserName(java.lang.String pUserName)
pUserName
- the UserName to setpublic java.lang.String Export()
public java.lang.String ExportXML()
public void Import(java.lang.String Val) throws PDException
Val
- String to be parsedPDException
- in any parsing errorpublic void ImportXML(java.lang.String Val) throws PDException
Val
- String to be parsedPDException
- in any parsing errorpublic void Verify() throws PDException
PDException
- if the values don't fullfil the Attribute definitionpublic java.lang.String toXML() throws PDException
PDException
- In any errorpublic java.lang.String toXMLt() throws PDException
PDException
- in any errorpublic java.lang.String toXMLFull() throws PDException
PDException
- in any errorpublic boolean isMultivalued()
public void setMultivalued(boolean Multivalued)
Multivalued
- the Multivalued to setpublic java.util.TreeSet getValuesList() throws PDException
PDException
- In any errorpublic boolean AddValue(java.lang.Object pValue) throws PDException
pValue
- new value to addPDException
- in ay errorpublic boolean RemoveValue(java.lang.Object pValue) throws PDException
pValue
- to removePDException
- in ay errorpublic void ClearValues() throws PDException
PDException
- If it's not multivalued Attributepublic java.lang.String ToCSV()
public static java.lang.String BD2String(java.math.BigDecimal BD)
BD
- value t be convertedpublic static java.lang.String BD2StringDDBB(java.math.BigDecimal BD)
BD
- value t be convertedpublic static java.math.BigDecimal String2BD(java.lang.String SBD)
SBD
- String to e evaluatedpublic static java.math.BigDecimal String2BDDDBB(java.lang.String SBD)
SBD
- String to e evaluated