Class ValueTypeProp

All Implemented Interfaces:
EventListener, IGProp<String>, Cloneable

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

    • 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:
      NullPointerException - If type is null.
  • Method Details

    • clone

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

      public boolean setPropValue(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.
      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:
      NullPointerException - If type is null.
    • validatePropType

      public void validatePropType(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<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.