com.abra.j2xb.beans.propertyEditors
Class MONumberPropertyEditor

java.lang.Object
  extended by com.abra.j2xb.beans.propertyEditors.MONumberPropertyEditor
All Implemented Interfaces:
MOPropertyEditor
Direct Known Subclasses:
MOBigDecimalPropertyEditor, MOBigIntegerPropertyEditor, MOBytePropertyEditor, MODoublePropertyEditor, MOFloatPropertyEditor, MOIntegerPropertyEditor, MOLongPropertyEditor, MOShortPropertyEditor

public abstract class MONumberPropertyEditor
extends java.lang.Object
implements MOPropertyEditor

Since:
JDK1.5
Version:
1.0, May 1, 2008
Author:
Yoav Abrahami

Constructor Summary
MONumberPropertyEditor()
           
 
Method Summary
 java.lang.Object fromXmlValue(MOPropertySimpleTypeDescriptor simpleTypeDescriptor, XmlValue value)
          decodes the property value from the value used to store in XML.
 java.lang.String[] getEnumerations(java.lang.Class<?> propertyValueType)
           
protected abstract  java.lang.String getNumberTypeName()
           
 boolean supportsNumberValidations()
          indicates that the type supports the MOValidationNumber for Number validations
 boolean supportsStringValidations()
          indicates that the type supports the MOValidationString for string validations
 XmlValue toXmlValue(MOPropertySimpleTypeDescriptor simpleTypeDescriptor, java.lang.Object value)
          encodes the value to XML representation
 MOValueValidationResult validateStringEncoding(java.lang.Class propertyValueType, java.lang.String value)
          validates the string encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.abra.j2xb.beans.propertyEditors.MOPropertyEditor
compareValues, fromString, getXmlDefaultSimpleType, isCompatibleSimpleType, toString
 

Constructor Detail

MONumberPropertyEditor

public MONumberPropertyEditor()
Method Detail

fromXmlValue

public java.lang.Object fromXmlValue(MOPropertySimpleTypeDescriptor simpleTypeDescriptor,
                                     XmlValue value)
Description copied from interface: MOPropertyEditor
decodes the property value from the value used to store in XML.

Specified by:
fromXmlValue in interface MOPropertyEditor
Parameters:
simpleTypeDescriptor - descriptor for simple type instance
value - - the value to decode
Returns:
decoded value.

toXmlValue

public XmlValue toXmlValue(MOPropertySimpleTypeDescriptor simpleTypeDescriptor,
                           java.lang.Object value)
Description copied from interface: MOPropertyEditor
encodes the value to XML representation

Specified by:
toXmlValue in interface MOPropertyEditor
Parameters:
simpleTypeDescriptor - descriptor for simple type instance
value - - the value to encode
Returns:
encoded value.

getEnumerations

public java.lang.String[] getEnumerations(java.lang.Class<?> propertyValueType)
Specified by:
getEnumerations in interface MOPropertyEditor
Parameters:
propertyValueType - the enumeration class
Returns:
XML enumeration restriction

validateStringEncoding

public MOValueValidationResult validateStringEncoding(java.lang.Class propertyValueType,
                                                      java.lang.String value)
Description copied from interface: MOPropertyEditor
validates the string encoding.

Specified by:
validateStringEncoding in interface MOPropertyEditor
Parameters:
propertyValueType - the class of the propery value
value - - string encoding to validate
Returns:
validation object specifing if the value is valid, and if not a problem description

getNumberTypeName

protected abstract java.lang.String getNumberTypeName()

supportsStringValidations

public boolean supportsStringValidations()
Description copied from interface: MOPropertyEditor
indicates that the type supports the MOValidationString for string validations

Specified by:
supportsStringValidations in interface MOPropertyEditor
Returns:
true if support

supportsNumberValidations

public boolean supportsNumberValidations()
Description copied from interface: MOPropertyEditor
indicates that the type supports the MOValidationNumber for Number validations

Specified by:
supportsNumberValidations in interface MOPropertyEditor
Returns:
true if support


Copyright © 2008. All Rights Reserved.