Package org.openxava.model.meta
Class MetaProperty
- java.lang.Object
-
- org.openxava.util.meta.MetaElement
-
- org.openxava.model.meta.MetaMember
-
- org.openxava.model.meta.MetaProperty
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<MetaMember>
- Direct Known Subclasses:
MetaViewAction
,PropertiesSeparator
public class MetaProperty extends MetaMember implements java.lang.Cloneable
- Author:
- Javier Paniza; modified by Radoslaw OStrzycki, Newitech Sp. z o.o.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MetaProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addMetaValidator(MetaValidator metaValidator)
void
addValidValue(java.lang.Object validValue)
MetaProperty
cloneMetaProperty()
void
containsValidValue(java.lang.Object value)
ICalculator
createDefaultValueCalculator()
boolean
depends(MetaProperty other)
boolean
equals(java.lang.Object o)
java.lang.String
format(java.lang.Object value)
Convert a valid value for this property in a String valid for display to user.java.lang.String
format(java.lang.Object value, java.util.Locale locale)
Convert a valid value for this property in a String valid for display to user.java.lang.String
getCalculation()
ICalculator
getCalculator()
java.lang.String
getCMPTypeName()
java.util.Collection
getDependentPropertiesNames()
java.lang.String
getHbmGeneratorCode()
PropertyMapping
getMapping()
Can be nullMetaCalculator
getMetaCalculator()
MetaCalculator
getMetaCalculatorDefaultValue()
java.util.Collection
getMetaValidators()
java.util.Set<java.lang.String>
getPropertiesNamesUsedForCalculation()
java.lang.String
getQualifiedLabel()
java.lang.String
getQualifiedLabel(java.util.Locale locale)
java.lang.String
getQualifiedLabel(javax.servlet.ServletRequest request)
java.lang.String
getRequiredMessage()
int
getScale()
int
getSize()
java.lang.String
getStereotype()
java.lang.Class
getType()
java.lang.String
getTypeName()
java.lang.Object
getValidValue(int i)
int
getValidValueIndex(java.lang.Object value)
The first value is 1, to left 0 for no value case.java.lang.String
getValidValueLabel(int i)
java.lang.String
getValidValueLabel(java.lang.Object value)
java.lang.String
getValidValueLabel(java.util.Locale locale, int i)
java.lang.String
getValidValueLabel(java.util.Locale locale, java.lang.Object value)
java.lang.String
getValidValueLabel(javax.servlet.ServletRequest request, int i)
Deprecated.Use getValidValueLabel(int i) insteadjava.lang.String
getValidValueLabel(javax.servlet.ServletRequest request, java.lang.Object value)
Deprecated.Use getValidValue(Object value) insteadjava.lang.String
getValidValuesLabels(java.util.Locale locale)
A string with the localized labels separate with '|'.java.lang.String
getValidValuesLabels(javax.servlet.ServletRequest request)
A string with the localized labels separate with '|'.boolean
hasCalculation()
boolean
hasCalculator()
boolean
hasCalculatorDefaultValueOnCreate()
boolean
hasDefaultValueCalculator()
boolean
hasDependentProperties()
int
hashCode()
boolean
hasMetaModel()
boolean
hasNotDependentDefaultValueCalculator()
boolean
hasStereotype()
boolean
hasValidValues()
boolean
isCalculated()
boolean
isCompatibleWith(java.lang.Class type)
Verify if the type, stereotype or any annotation of the property is compatible with the indicated type.boolean
isDefaultCalculatorHibernateIdGenerator()
boolean
isFile(java.lang.Object object)
boolean
isFilterCapable()
boolean
isHidden()
boolean
isKey()
boolean
isNotFieldBackedAndNotCalculated()
boolean
isNumber()
boolean
isPersistent()
boolean
isReadOnly()
boolean
isRequired()
boolean
isSearchKey()
boolean
isTypeOrStereotypeCompatibleWith(java.lang.Class type)
Deprecated.boolean
isVersion()
java.lang.Object
parse(java.lang.String value)
Convert the argument in a object of type valid for assign to this property.java.lang.Object
parse(java.lang.String value, java.util.Locale locale)
Convert the argument in a object of type valid for assign to this property.void
setCalculation(java.lang.String calculation)
void
setHidden(boolean hidden)
void
setKey(boolean key)
void
setLabel(java.lang.String newLabel)
void
setMetaCalculator(MetaCalculator metaCalculator)
void
setMetaCalculatorDefaultValue(MetaCalculator metaCalculatorDefaultValue)
void
setNotFieldBackedAndNotCalculated(boolean notFieldBackedAndNotCalculated)
void
setQualifiedLabel(java.lang.String qualifiedLabel)
void
setReadOnly(boolean readOnly)
void
setRequired(boolean newRequired)
void
setRequiredMessage(java.lang.String requiredMessage)
void
setScale(int newScale)
void
setSearchKey(boolean searchKey)
void
setSize(int newSize)
void
setStereotype(java.lang.String newStereotype)
void
setTypeName(java.lang.String type)
void
setVersion(boolean version)
java.lang.String
toString()
boolean
usesForCalculation(java.lang.String qualifiedPropertyName)
void
validate(Messages errors, java.lang.Object object)
void
validate(Messages errors, java.lang.Object object, boolean creating)
void
validate(Messages errors, java.lang.Object object, boolean creating, java.lang.String container)
java.util.Iterator
validValues()
java.util.Iterator
validValuesLabels()
java.util.Iterator
validValuesLabels(java.util.Locale locale)
java.util.Iterator
validValuesLabels(javax.servlet.ServletRequest request)
Deprecated.Use validValuesLabels() instead-
Methods inherited from class org.openxava.model.meta.MetaMember
compareTo, getAnnotations, getId, getLabel, getLabelId, getMetaModel, getPropertyNamesThatIDepend, getQualifiedName, getSimpleName, isTransient, setLabelId, setMetaModel, setQualifiedName, setTransient, toQualifiedNames
-
Methods inherited from class org.openxava.util.meta.MetaElement
getDescription, getDescription, getDescription, getDescription, getLabel, getLabel, getLabel, getLocale, getName, getPlaceholder, getPlaceholder, getPlaceholder, has18nLabel, hasName, setDescription, setName, setPlaceholder
-
-
-
-
Method Detail
-
setLabel
public void setLabel(java.lang.String newLabel)
- Overrides:
setLabel
in classMetaMember
-
addValidValue
public void addValidValue(java.lang.Object validValue)
-
containsValidValue
public void containsValidValue(java.lang.Object value)
-
getValidValue
public java.lang.Object getValidValue(int i) throws XavaException
- Throws:
XavaException
-
getValidValueIndex
public int getValidValueIndex(java.lang.Object value)
The first value is 1, to left 0 for no value case.
-
getValidValueLabel
public java.lang.String getValidValueLabel(int i) throws XavaException
- Throws:
XavaException
-
getValidValueLabel
public java.lang.String getValidValueLabel(javax.servlet.ServletRequest request, int i) throws XavaException
Deprecated.Use getValidValueLabel(int i) insteadDeprecated since 3.1.- Throws:
XavaException
-
getValidValueLabel
public java.lang.String getValidValueLabel(java.util.Locale locale, java.lang.Object value)
-
getValidValueLabel
public java.lang.String getValidValueLabel(java.lang.Object value)
-
getValidValueLabel
public java.lang.String getValidValueLabel(javax.servlet.ServletRequest request, java.lang.Object value)
Deprecated.Use getValidValue(Object value) insteadDeprecated since 3.1.
-
getValidValueLabel
public java.lang.String getValidValueLabel(java.util.Locale locale, int i) throws XavaException
- Throws:
XavaException
-
getQualifiedLabel
public java.lang.String getQualifiedLabel(java.util.Locale locale) throws XavaException
- Throws:
XavaException
-
getQualifiedLabel
public java.lang.String getQualifiedLabel(javax.servlet.ServletRequest request) throws XavaException
- Throws:
XavaException
-
getValidValuesLabels
public java.lang.String getValidValuesLabels(javax.servlet.ServletRequest request)
A string with the localized labels separate with '|'.
-
getValidValuesLabels
public java.lang.String getValidValuesLabels(java.util.Locale locale)
A string with the localized labels separate with '|'.
-
getStereotype
public java.lang.String getStereotype()
-
hasStereotype
public boolean hasStereotype()
-
isNumber
public boolean isNumber() throws XavaException
- Throws:
XavaException
-
getSize
public int getSize() throws XavaException
- Returns:
- Can return -1 if the datatype does not have length concept
- Throws:
XavaException
-
getScale
public int getScale() throws XavaException
- Returns:
- scale param
- Throws:
XavaException
-
getType
public java.lang.Class getType() throws XavaException
- Throws:
XavaException
-
getCMPTypeName
public java.lang.String getCMPTypeName() throws XavaException
- Throws:
XavaException
-
getTypeName
public java.lang.String getTypeName() throws XavaException
- Throws:
XavaException
-
setTypeName
public void setTypeName(java.lang.String type) throws XavaException
- Throws:
XavaException
-
hasNotDependentDefaultValueCalculator
public boolean hasNotDependentDefaultValueCalculator()
- Since:
- 5.1
-
hasDefaultValueCalculator
public boolean hasDefaultValueCalculator()
- Overrides:
hasDefaultValueCalculator
in classMetaMember
-
hasCalculator
public boolean hasCalculator()
- Overrides:
hasCalculator
in classMetaMember
-
createDefaultValueCalculator
public ICalculator createDefaultValueCalculator() throws XavaException
- Returns:
- null if this does not have calculator for default value
- Throws:
XavaException
-
getCalculator
public ICalculator getCalculator() throws XavaException
- Returns:
- null if this does not have calculator
- Throws:
XavaException
-
isDefaultCalculatorHibernateIdGenerator
public boolean isDefaultCalculatorHibernateIdGenerator() throws XavaException
- Throws:
XavaException
-
getHbmGeneratorCode
public java.lang.String getHbmGeneratorCode() throws XavaException
- Throws:
XavaException
-
getMetaValidators
public java.util.Collection getMetaValidators()
-
isKey
public boolean isKey()
-
setKey
public void setKey(boolean key)
-
isFilterCapable
public boolean isFilterCapable()
- Since:
- 7.1.4
-
isNotFieldBackedAndNotCalculated
public boolean isNotFieldBackedAndNotCalculated()
- Since:
- 7.1.4
-
setNotFieldBackedAndNotCalculated
public void setNotFieldBackedAndNotCalculated(boolean notFieldBackedAndNotCalculated)
-
isCalculated
public boolean isCalculated()
-
isPersistent
public boolean isPersistent() throws XavaException
- Throws:
XavaException
-
isRequired
public boolean isRequired()
-
setStereotype
public void setStereotype(java.lang.String newStereotype)
-
setRequired
public void setRequired(boolean newRequired)
-
setSize
public void setSize(int newSize)
-
setScale
public void setScale(int newScale)
-
hasValidValues
public boolean hasValidValues()
-
validate
public void validate(Messages errors, java.lang.Object object) throws java.rmi.RemoteException
- Throws:
java.rmi.RemoteException
-
validate
public void validate(Messages errors, java.lang.Object object, boolean creating) throws java.rmi.RemoteException
- Throws:
java.rmi.RemoteException
-
validate
public void validate(Messages errors, java.lang.Object object, boolean creating, java.lang.String container) throws java.rmi.RemoteException
- Throws:
java.rmi.RemoteException
- Since:
- 6.2.1
-
validValues
public java.util.Iterator validValues()
-
validValuesLabels
public java.util.Iterator validValuesLabels()
-
validValuesLabels
public java.util.Iterator validValuesLabels(javax.servlet.ServletRequest request)
Deprecated.Use validValuesLabels() insteadDeprecated since 3.1.
-
validValuesLabels
public java.util.Iterator validValuesLabels(java.util.Locale locale)
-
isReadOnly
public boolean isReadOnly() throws XavaException
- Throws:
XavaException
-
cloneMetaProperty
public MetaProperty cloneMetaProperty() throws XavaException
- Throws:
XavaException
-
getMetaCalculator
public MetaCalculator getMetaCalculator()
- Overrides:
getMetaCalculator
in classMetaMember
-
setMetaCalculator
public void setMetaCalculator(MetaCalculator metaCalculator)
-
getMetaCalculatorDefaultValue
public MetaCalculator getMetaCalculatorDefaultValue()
- Overrides:
getMetaCalculatorDefaultValue
in classMetaMember
-
setMetaCalculatorDefaultValue
public void setMetaCalculatorDefaultValue(MetaCalculator metaCalculatorDefaultValue)
-
hasDependentProperties
public boolean hasDependentProperties() throws XavaException
- Throws:
XavaException
-
getDependentPropertiesNames
public java.util.Collection getDependentPropertiesNames() throws XavaException
- Throws:
XavaException
-
depends
public boolean depends(MetaProperty other) throws XavaException
- Parameters:
other
- Can be null, in which case return false- Throws:
XavaException
-
hasMetaModel
public boolean hasMetaModel()
-
setReadOnly
public void setReadOnly(boolean readOnly)
-
isHidden
public boolean isHidden()
- Overrides:
isHidden
in classMetaMember
-
setHidden
public void setHidden(boolean hidden)
-
hasCalculatorDefaultValueOnCreate
public boolean hasCalculatorDefaultValueOnCreate()
-
getMapping
public PropertyMapping getMapping() throws XavaException
Can be null- Throws:
XavaException
-
parse
public java.lang.Object parse(java.lang.String value) throws java.text.ParseException, XavaException
Convert the argument in a object of type valid for assign to this property.Convierte el argumento enviado en un objeto de tipo v�lido para asignar a esta propiedad.
If argument is primitive return the match wrapper.
- Returns:
- Can be null
- Throws:
java.text.ParseException
XavaException
-
parse
public java.lang.Object parse(java.lang.String value, java.util.Locale locale) throws java.text.ParseException, XavaException
Convert the argument in a object of type valid for assign to this property.If argument is primitive return the match wrapper.
- Returns:
- Can be null
- Throws:
java.text.ParseException
XavaException
-
isTypeOrStereotypeCompatibleWith
@Deprecated public boolean isTypeOrStereotypeCompatibleWith(java.lang.Class type)
Deprecated.
-
isCompatibleWith
public boolean isCompatibleWith(java.lang.Class type)
Verify if the type, stereotype or any annotation of the property is compatible with the indicated type.- Since:
- 6.6
-
format
public java.lang.String format(java.lang.Object value) throws XavaException
Convert a valid value for this property in a String valid for display to user.- Returns:
- Can be null.
- Throws:
XavaException
-
format
public java.lang.String format(java.lang.Object value, java.util.Locale locale) throws XavaException
Convert a valid value for this property in a String valid for display to user.- Returns:
- Can be null.
- Throws:
XavaException
-
addMetaValidator
public void addMetaValidator(MetaValidator metaValidator)
-
usesForCalculation
public boolean usesForCalculation(java.lang.String qualifiedPropertyName)
-
getPropertiesNamesUsedForCalculation
public java.util.Set<java.lang.String> getPropertiesNamesUsedForCalculation()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
isVersion
public boolean isVersion()
-
setVersion
public void setVersion(boolean version)
-
isSearchKey
public boolean isSearchKey()
-
setSearchKey
public void setSearchKey(boolean searchKey)
-
getRequiredMessage
public java.lang.String getRequiredMessage()
-
setRequiredMessage
public void setRequiredMessage(java.lang.String requiredMessage)
-
getQualifiedLabel
public java.lang.String getQualifiedLabel()
-
setQualifiedLabel
public void setQualifiedLabel(java.lang.String qualifiedLabel)
-
getCalculation
public java.lang.String getCalculation()
-
setCalculation
public void setCalculation(java.lang.String calculation)
-
hasCalculation
public boolean hasCalculation()
- Since:
- 5.7
-
isFile
public boolean isFile(java.lang.Object object)
-
-