Class ValueTypeProp

  • All Implemented Interfaces:
    EventListener, IGProp<java.lang.String>, java.lang.Cloneable

    public class ValueTypeProp
    extends StringProp
    The Value Type property for the Value Type as a String, without Value.
    Author:
    Christopher Mindus
    • Constructor Detail

      • ValueTypeProp

        protected ValueTypeProp()
        Creates a Value Type property with no name and with a null value.
      • ValueTypeProp

        public ValueTypeProp​(Atom propertyAtom)
        Creates a Value Type property with the specified name with a null value.
        Parameters:
        propertyAtom - the property atom.
      • ValueTypeProp

        public ValueTypeProp​(Atom propertyAtom,
                             Value.Type type)
        Creates a Value Type property with the specified name and value.
        Parameters:
        propertyAtom - the property atom.
        type - the Value type, not null.
        Throws:
        java.lang.NullPointerException - If type is null.
    • Method Detail

      • clone

        public ValueTypeProp clone()
        Clones the Value Type property.
        Overrides:
        clone in class StringProp
        Returns:
        A new cloned String property.
      • setPropValue

        public boolean setPropValue​(java.lang.String type)
                             throws PropValidateException
        Sets a new value for this property. If any listener is present and the value has changed compare to the last value, the listener is informed.
        Overrides:
        setPropValue in class StringProp
        Parameters:
        type - the new value type.
        Returns:
        boolean true for value has changed, false for same value as current value.
        Throws:
        PropValidateException - When the String Value Type is not correct.
        java.lang.NullPointerException - If type is null.
      • setValueType

        public boolean setValueType​(Value.Type type)
        Sets the Value Type property value.
        Parameters:
        type - The Value Type, not null.
        Returns:
        boolean true for value has changed, false for same value as current value.
        Throws:
        java.lang.NullPointerException - If type is null.
      • validatePropType

        public void validatePropType​(java.lang.Object newValue)
                              throws PropTypeException
        Validates that the value to set is of String instance.

        Note: When this method is called, synchronization is done at the property itself, so no synchronization on the tree should be done.

        Specified by:
        validatePropType in interface IGProp<java.lang.String>
        Overrides:
        validatePropType in class StringProp
        Parameters:
        newValue - The new value to set.
        Throws:
        PropTypeException - when the new value isn't of the correct class.
      • getValueType

        public Value.Type getValueType()
        Gets the value type.
        Returns:
        The Value Type, or null if not defined.