Interface PrimitiveDomainType
-
- All Superinterfaces:
DomainType
- All Known Subinterfaces:
EnumerateDomainType
- All Known Implementing Classes:
AbsoluteDateTimeDomainType
,AbsoluteTimeDomainType
,BaseEnumerateDomainType
,BasePrimitiveDomainType
,BigDecimalDomainType
,BigDecimalDomainType.Amount
,BigDecimalDomainType.GeneralQuantity
,BigDecimalDomainType.Number
,BigDecimalDomainType.Price
,BigDecimalDomainType.Quantity
,BinaryDomainType
,BooleanDomainType
,ButtonDomainType
,DateDomainType
,DatetimeDomainType
,EncryptedStringDomainType
,HashedStringDomainType
,LongDomainType
,ModelElementDomainType
,ObjectDomainType
,ProductCharacteristicsDomainType
,StringDomainType
,StringEnumerateDomainType
,TimestampDomainType
,UniqueIdDomainType
public interface PrimitiveDomainType extends DomainType
The ModelReference implements the reference extensions used for the Data Access Layer. See here for more information.- Author:
- mtaal
-
-
Field Summary
Fields Modifier and Type Field Description static String
EMPTY_STRING
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
convertToString(Object value)
Converts an object value of this type to a locale/system neutral String.Object
createFromString(String strValue)
Converts a string back to an object value of the primitive type ({link #getPrimitiveType()}) represented by this DomainType.String
getFormatId()
Returns the id of the format definition to use for this domain type.Class<?>
getHibernateType()
The type used in the hibernate mapping.Class<?>
getPrimitiveType()
The primitive type class (for example java.lang.Long) if this is a primitive type.String
getXMLSchemaType()
-
Methods inherited from interface org.openbravo.base.model.domaintype.DomainType
checkIsValidValue, checkObjectIsValid, getModelProvider, getReference, initialize, setModelProvider, setReference
-
-
-
-
Field Detail
-
EMPTY_STRING
static final String EMPTY_STRING
- See Also:
- Constant Field Values
-
-
Method Detail
-
convertToString
String convertToString(Object value)
Converts an object value of this type to a locale/system neutral String. Is used in XML conversion. The opposite of this method is thecreateFromString(String)
method.- Parameters:
value
- the value to convert to a string.- Returns:
- the String representation, if the value is null then an empty String is returned
- Throws:
IllegalArgumentException
- if the conversion is not possible
-
createFromString
Object createFromString(String strValue)
Converts a string back to an object value of the primitive type ({link #getPrimitiveType()}) represented by this DomainType. This method is the opposite of theconvertToString(Object)
method.- Parameters:
strValue
- the string value to convert- Returns:
- the object value, null is returned if an empty string or null are passed as parameter.
- Throws:
IllegalArgumentException
- if the conversion is not possible
-
getXMLSchemaType
String getXMLSchemaType()
- Returns:
- the xml schema type which matches the primitive type, is used to create the XML Schema for the REST web services.
-
getHibernateType
Class<?> getHibernateType()
The type used in the hibernate mapping. Most of the time is the same as thegetPrimitiveType()
. Can be used to set a hibnernate user type class. See the hibernate documentation for more information on this.- Returns:
- the class representing the hibernate type
-
getPrimitiveType
Class<?> getPrimitiveType()
The primitive type class (for example java.lang.Long) if this is a primitive type.- Returns:
- the class representing the primitive type
-
getFormatId
String getFormatId()
Returns the id of the format definition to use for this domain type. Is normally only relevant for numeric domain types. The id is the prefix part of the name in the Format.xml file. So for example the id 'integer' maps to all the Format.xml entries with integer as a prefix.- Returns:
- the name of the format definition in the format.xml, if not relevant then null is returned.
-
-