org.openxava.model.meta
Class MetaProperty

java.lang.Object
  extended by org.openxava.util.meta.MetaElement
      extended by org.openxava.model.meta.MetaMember
          extended by org.openxava.model.meta.MetaProperty
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
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
MetaProperty()
           
 
Method Summary
 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.
 ICalculator getCalculator()
           
 java.lang.String getCMPTypeName()
           
 java.util.Collection getDependentPropertiesNames()
           
 java.lang.String getHbmGeneratorCode()
           
 PropertyMapping getMapping()
          Can be null
 MetaCalculator getMetaCalculator()
           
 MetaCalculator getMetaCalculatorDefaultValue()
           
 java.util.Collection getMetaValidators()
           
 java.util.Collection getPropertyNamesThatIDepend()
           
 java.lang.String getQualifiedLabel(java.util.Locale locale)
           
 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.util.Locale locale, java.lang.Object value)
           
 java.lang.String getValidValueLabel(java.lang.Object value)
           
 java.lang.String getValidValueLabel(ServletRequest request, int i)
          Deprecated. Use getValidValueLabel(int i) instead
 java.lang.String getValidValuesLabels(ServletRequest request)
          A string with the localized labels separate with '|'.
 boolean hasCalculator()
           
 boolean hasCalculatorDefaultValueOnCreate()
           
 boolean hasDefaultValueCalculator()
           
 boolean hasDependentProperties()
           
 int hashCode()
           
 boolean hasMetaModel()
           
 boolean hasStereotype()
           
 boolean hasValidValues()
           
 boolean isCalculated()
           
 boolean isDefaultCalculatorHibernateIdGenerator()
           
 boolean isHidden()
           
 boolean isKey()
           
 boolean isNumber()
           
 boolean isPersistent()
           
 boolean isReadOnly()
           
 boolean isRequired()
           
 boolean isSearchKey()
           
 boolean isTransient()
           
 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 setHidden(boolean hidden)
           
 void setKey(boolean key)
           
 void setMetaCalculator(MetaCalculator metaCalculator)
           
 void setMetaCalculatorDefaultValue(MetaCalculator metaCalculatorDefaultValue)
           
 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 setTransient(boolean _transient)
           
 void setTypeName(java.lang.String type)
           
 void setVersion(boolean version)
           
 java.lang.String toString()
           
 void validate(Messages errors, java.lang.Object object)
           
 void validate(Messages errors, java.lang.Object object, boolean creating)
           
 java.util.Iterator validValues()
           
 java.util.Iterator validValuesLabels()
           
 java.util.Iterator validValuesLabels(ServletRequest request)
          Deprecated. Use validValuesLabels() instead
 
Methods inherited from class org.openxava.model.meta.MetaMember
compareTo, getId, getLabelId, getMetaModel, getQualifiedName, setLabelId, setMetaModel, setQualifiedName
 
Methods inherited from class org.openxava.util.meta.MetaElement
getDescription, getDescription, getDescription, getLabel, getLabel, getLabel, getLocale, getName, has18nLabel, hasName, setDescription, setLabel, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaProperty

public MetaProperty()
Method Detail

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(ServletRequest request,
                                           int i)
                                    throws XavaException
Deprecated. Use getValidValueLabel(int i) instead

Deprecated 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)

getQualifiedLabel

public java.lang.String getQualifiedLabel(java.util.Locale locale)
                                   throws XavaException
Throws:
XavaException

getValidValuesLabels

public java.lang.String getValidValuesLabels(ServletRequest request)
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

hasDefaultValueCalculator

public boolean hasDefaultValueCalculator()

hasCalculator

public boolean hasCalculator()

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)

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

validValues

public java.util.Iterator validValues()

validValuesLabels

public java.util.Iterator validValuesLabels()

validValuesLabels

public java.util.Iterator validValuesLabels(ServletRequest request)
Deprecated. Use validValuesLabels() instead

Deprecated since 3.1.


isReadOnly

public boolean isReadOnly()
                   throws XavaException
Throws:
XavaException

cloneMetaProperty

public MetaProperty cloneMetaProperty()
                               throws XavaException
Throws:
XavaException

getMetaCalculator

public MetaCalculator getMetaCalculator()

setMetaCalculator

public void setMetaCalculator(MetaCalculator metaCalculator)

getMetaCalculatorDefaultValue

public MetaCalculator getMetaCalculatorDefaultValue()

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()

getPropertyNamesThatIDepend

public java.util.Collection getPropertyNamesThatIDepend()

setReadOnly

public void setReadOnly(boolean readOnly)

isHidden

public boolean isHidden()
Overrides:
isHidden in class MetaMember

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

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)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isTransient

public boolean isTransient()

setTransient

public void setTransient(boolean _transient)

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)