Class MetaProperty

All Implemented Interfaces:
Serializable, Cloneable, Comparable<MetaMember>
Direct Known Subclasses:
MetaViewAction, PropertiesSeparator

public class MetaProperty extends MetaMember implements Cloneable
Author:
Javier Paniza; modified by Radoslaw OStrzycki, Newitech Sp. z o.o.
See Also:
  • Constructor Details

    • MetaProperty

      public MetaProperty()
  • Method Details

    • setLabel

      public void setLabel(String newLabel)
      Overrides:
      setLabel in class MetaMember
    • addValidValue

      public void addValidValue(Object validValue)
    • containsValidValue

      public void containsValidValue(Object value)
    • getValidValue

      public Object getValidValue(int i) throws XavaException
      Throws:
      XavaException
    • getValidValueIndex

      public int getValidValueIndex(Object value)
      The first value is 1, to left 0 for no value case.
    • getValidValueLabel

      public String getValidValueLabel(int i) throws XavaException
      Throws:
      XavaException
    • getValidValueLabel

      public String getValidValueLabel(javax.servlet.ServletRequest request, int i) throws XavaException
      Deprecated.
      Use getValidValueLabel(int i) instead
      Deprecated since 3.1.
      Throws:
      XavaException
    • getValidValueLabel

      public String getValidValueLabel(Locale locale, Object value)
    • getValidValueLabel

      public String getValidValueLabel(Object value)
    • getValidValueLabel

      public String getValidValueLabel(javax.servlet.ServletRequest request, Object value)
      Deprecated.
      Use getValidValue(Object value) instead
      Deprecated since 3.1.
    • getValidValueLabel

      public String getValidValueLabel(Locale locale, int i) throws XavaException
      Throws:
      XavaException
    • getQualifiedLabel

      public String getQualifiedLabel(Locale locale) throws XavaException
      Throws:
      XavaException
    • getQualifiedLabel

      public String getQualifiedLabel(javax.servlet.ServletRequest request) throws XavaException
      Throws:
      XavaException
    • getValidValuesLabels

      public String getValidValuesLabels(javax.servlet.ServletRequest request)
      A string with the localized labels separate with '|'.
    • getValidValuesLabels

      public String getValidValuesLabels(Locale locale)
      A string with the localized labels separate with '|'.
    • getStereotype

      public 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 Class getType() throws XavaException
      Throws:
      XavaException
    • getCMPTypeName

      public String getCMPTypeName() throws XavaException
      Throws:
      XavaException
    • getTypeName

      public String getTypeName() throws XavaException
      Throws:
      XavaException
    • setTypeName

      public void setTypeName(String type) throws XavaException
      Throws:
      XavaException
    • hasNotDependentDefaultValueCalculator

      public boolean hasNotDependentDefaultValueCalculator()
      Since:
      5.1
    • hasDefaultValueCalculator

      public boolean hasDefaultValueCalculator()
      Overrides:
      hasDefaultValueCalculator in class MetaMember
    • hasCalculator

      public boolean hasCalculator()
      Overrides:
      hasCalculator in class MetaMember
    • 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 String getHbmGeneratorCode() throws XavaException
      Throws:
      XavaException
    • getMetaValidators

      public 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(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, Object object) throws RemoteException
      Throws:
      RemoteException
    • validate

      public void validate(Messages errors, Object object, boolean creating) throws RemoteException
      Throws:
      RemoteException
    • validate

      public void validate(Messages errors, Object object, boolean creating, String container) throws RemoteException
      Throws:
      RemoteException
      Since:
      6.2.1
    • validValues

      public Iterator validValues()
    • validValuesLabels

      public Iterator validValuesLabels()
    • validValuesLabels

      public Iterator validValuesLabels(javax.servlet.ServletRequest request)
      Deprecated.
      Use validValuesLabels() instead
      Deprecated since 3.1.
    • validValuesLabels

      public Iterator validValuesLabels(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 class MetaMember
    • setMetaCalculator

      public void setMetaCalculator(MetaCalculator metaCalculator)
    • getMetaCalculatorDefaultValue

      public MetaCalculator getMetaCalculatorDefaultValue()
      Overrides:
      getMetaCalculatorDefaultValue in class MetaMember
    • setMetaCalculatorDefaultValue

      public void setMetaCalculatorDefaultValue(MetaCalculator metaCalculatorDefaultValue)
    • hasDependentProperties

      public boolean hasDependentProperties() throws XavaException
      Throws:
      XavaException
    • getDependentPropertiesNames

      public 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 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 Object parse(String value) throws 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:
      ParseException
      XavaException
    • parse

      public Object parse(String value, Locale locale) throws 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:
      ParseException
      XavaException
    • isTypeOrStereotypeCompatibleWith

      @Deprecated public boolean isTypeOrStereotypeCompatibleWith(Class type)
      Deprecated.
    • isCompatibleWith

      public boolean isCompatibleWith(Class type)
      Verify if the type, stereotype or any annotation of the property is compatible with the indicated type.
      Since:
      6.6
    • format

      public String format(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 String format(Object value, 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(String qualifiedPropertyName)
    • getPropertiesNamesUsedForCalculation

      public Set<String> getPropertiesNamesUsedForCalculation()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isVersion

      public boolean isVersion()
    • setVersion

      public void setVersion(boolean version)
    • isSearchKey

      public boolean isSearchKey()
    • setSearchKey

      public void setSearchKey(boolean searchKey)
    • getRequiredMessage

      public String getRequiredMessage()
    • setRequiredMessage

      public void setRequiredMessage(String requiredMessage)
    • getQualifiedLabel

      public String getQualifiedLabel()
    • setQualifiedLabel

      public void setQualifiedLabel(String qualifiedLabel)
    • getCalculation

      public String getCalculation()
    • setCalculation

      public void setCalculation(String calculation)
    • hasCalculation

      public boolean hasCalculation()
      Since:
      5.7
    • isFile

      public boolean isFile(Object object)
    • isDateType

      public boolean isDateType()
      Since:
      7.4.2
    • isDateTimeType

      public boolean isDateTimeType()
      Since:
      7.4.2
    • isUUIDNotFormattedInList

      public boolean isUUIDNotFormattedInList()
      Check if this property is a String of 32 characters (typical UUID/OID size) whose editor does not have a list-formatter.

      Such properties typically show just a raw OID value in lists which is not useful for users (e.g., IMAGES_GALLERY, DISCUSSION, FILES stereotipes). Properties with a list-formatter (e.g., FILE stereotype with AttachedFile editor) will return false because they display meaningful content.

      Since:
      7.7