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 voidaddMetaValidator(MetaValidator metaValidator)voidaddValidValue(java.lang.Object validValue)MetaPropertycloneMetaProperty()voidcontainsValidValue(java.lang.Object value)ICalculatorcreateDefaultValueCalculator()booleandepends(MetaProperty other)booleanequals(java.lang.Object o)java.lang.Stringformat(java.lang.Object value)Convert a valid value for this property in a String valid for display to user.java.lang.Stringformat(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.StringgetCalculation()ICalculatorgetCalculator()java.lang.StringgetCMPTypeName()java.util.CollectiongetDependentPropertiesNames()java.lang.StringgetHbmGeneratorCode()PropertyMappinggetMapping()Can be nullMetaCalculatorgetMetaCalculator()MetaCalculatorgetMetaCalculatorDefaultValue()java.util.CollectiongetMetaValidators()java.util.Set<java.lang.String>getPropertiesNamesUsedForCalculation()java.lang.StringgetQualifiedLabel()java.lang.StringgetQualifiedLabel(java.util.Locale locale)java.lang.StringgetQualifiedLabel(javax.servlet.ServletRequest request)java.lang.StringgetRequiredMessage()intgetScale()intgetSize()java.lang.StringgetStereotype()java.lang.ClassgetType()java.lang.StringgetTypeName()java.lang.ObjectgetValidValue(int i)intgetValidValueIndex(java.lang.Object value)The first value is 1, to left 0 for no value case.java.lang.StringgetValidValueLabel(int i)java.lang.StringgetValidValueLabel(java.lang.Object value)java.lang.StringgetValidValueLabel(java.util.Locale locale, int i)java.lang.StringgetValidValueLabel(java.util.Locale locale, java.lang.Object value)java.lang.StringgetValidValueLabel(javax.servlet.ServletRequest request, int i)Deprecated.Use getValidValueLabel(int i) insteadjava.lang.StringgetValidValueLabel(javax.servlet.ServletRequest request, java.lang.Object value)Deprecated.Use getValidValue(Object value) insteadjava.lang.StringgetValidValuesLabels(java.util.Locale locale)A string with the localized labels separate with '|'.java.lang.StringgetValidValuesLabels(javax.servlet.ServletRequest request)A string with the localized labels separate with '|'.booleanhasCalculation()booleanhasCalculator()booleanhasCalculatorDefaultValueOnCreate()booleanhasDefaultValueCalculator()booleanhasDependentProperties()inthashCode()booleanhasMetaModel()booleanhasNotDependentDefaultValueCalculator()booleanhasStereotype()booleanhasValidValues()booleanisCalculated()booleanisCompatibleWith(java.lang.Class type)Verify if the type, stereotype or any annotation of the property is compatible with the indicated type.booleanisDateTimeType()booleanisDateType()booleanisDefaultCalculatorHibernateIdGenerator()booleanisFile(java.lang.Object object)booleanisFilterCapable()booleanisHidden()booleanisInteger()booleanisKey()booleanisNotFieldBackedAndNotCalculated()booleanisNumber()booleanisPersistent()booleanisReadOnly()booleanisRequired()booleanisSearchKey()booleanisTypeOrStereotypeCompatibleWith(java.lang.Class type)Deprecated.booleanisVersion()java.lang.Objectparse(java.lang.String value)Convert the argument in a object of type valid for assign to this property.java.lang.Objectparse(java.lang.String value, java.util.Locale locale)Convert the argument in a object of type valid for assign to this property.voidsetCalculation(java.lang.String calculation)voidsetHidden(boolean hidden)voidsetKey(boolean key)voidsetLabel(java.lang.String newLabel)voidsetMetaCalculator(MetaCalculator metaCalculator)voidsetMetaCalculatorDefaultValue(MetaCalculator metaCalculatorDefaultValue)voidsetNotFieldBackedAndNotCalculated(boolean notFieldBackedAndNotCalculated)voidsetQualifiedLabel(java.lang.String qualifiedLabel)voidsetReadOnly(boolean readOnly)voidsetRequired(boolean newRequired)voidsetRequiredMessage(java.lang.String requiredMessage)voidsetScale(int newScale)voidsetSearchKey(boolean searchKey)voidsetSize(int newSize)voidsetStereotype(java.lang.String newStereotype)voidsetTypeName(java.lang.String type)voidsetVersion(boolean version)java.lang.StringtoString()booleanusesForCalculation(java.lang.String qualifiedPropertyName)voidvalidate(Messages errors, java.lang.Object object)voidvalidate(Messages errors, java.lang.Object object, boolean creating)voidvalidate(Messages errors, java.lang.Object object, boolean creating, java.lang.String container)java.util.IteratorvalidValues()java.util.IteratorvalidValuesLabels()java.util.IteratorvalidValuesLabels(java.util.Locale locale)java.util.IteratorvalidValuesLabels(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:
setLabelin 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 XavaExceptionDeprecated.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
-
isInteger
public boolean isInteger()
- Since:
- 7.4.5
-
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:
hasDefaultValueCalculatorin classMetaMember
-
hasCalculator
public boolean hasCalculator()
- Overrides:
hasCalculatorin 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:
getMetaCalculatorin classMetaMember
-
setMetaCalculator
public void setMetaCalculator(MetaCalculator metaCalculator)
-
getMetaCalculatorDefaultValue
public MetaCalculator getMetaCalculatorDefaultValue()
- Overrides:
getMetaCalculatorDefaultValuein 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:
isHiddenin 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, XavaExceptionConvert 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.ParseExceptionXavaException
-
parse
public java.lang.Object parse(java.lang.String value, java.util.Locale locale) throws java.text.ParseException, XavaExceptionConvert 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.ParseExceptionXavaException
-
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 XavaExceptionConvert 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 XavaExceptionConvert 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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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)
-
isDateType
public boolean isDateType()
- Since:
- 7.4.2
-
isDateTimeType
public boolean isDateTimeType()
- Since:
- 7.4.2
-
-