Class InputVariable

All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, IVSComponentListener, IVSComponentState, IVSFieldListener, Cloneable
Direct Known Subclasses:
EditorInputVariable

public class InputVariable extends AbstractVSVariable<VSField,VSFieldReference> implements IVSFieldListener
The Input Variable connects a VSField with an input variable or parameter to an SQL query statement.
Author:
Christopher Mindus
  • Constructor Details

    • InputVariable

      public InputVariable()
      Creates an input variable property container with the specified name with a null value.
    • InputVariable

      public InputVariable(Atom propertyAtom)
      Creates an input variable property container with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
  • Method Details

    • clone

      public InputVariable clone()
      Clones this variable instance.
      Overrides:
      clone in class AbstractVSVariable<VSField,VSFieldReference>
    • getVSPropertyClass

      public Class<VSField> getVSPropertyClass()
      Gets the class wanted for the VS component being referenced.
      Specified by:
      getVSPropertyClass in class AbstractVSVariable<VSField,VSFieldReference>
      Returns:
      VSField.class, VSColumnHeader.class or VSTable.class.
    • getVSReferenceClass

      public Class<VSFieldReference> getVSReferenceClass()
      Gets the class wanted for VS references.
      Specified by:
      getVSReferenceClass in class AbstractVSVariable<VSField,VSFieldReference>
      Returns:
      VSFieldReference.class.
    • getVSField

      public VSField getVSField()
      Gets the VSField.
      Returns:
      The VSField associated, or null for none (or unresolved).
    • setSQLDataType

      protected boolean setSQLDataType(int type)
      Sets the SQL data type.

      This method is used internally by the Designer during creation of the SQL statement and should not be called elsewhere.

      Parameters:
      type - The SQL data type for the column as defined by Types.
      Returns:
      true for changed, false for no change.
    • getSQLDataType

      public int getSQLDataType()
      Gets the SQL data type.
      Returns:
      The SQL data type for the column as defined by Types, or 0 if SQL statement is not yet parsed in the Designer, or if the column has been left "hanging around" and not yet deleted (this is a problem with warning severity level). This value should NEVER be 0 in the Server, unless it's running in Development Mode!
    • getSQLDataTypeString

      public String getSQLDataTypeString()
      Gets the SQL data type string.
      Returns:
      The SQL data type for the column as defined by Types, or "unknown" if not found or undefined
    • getDescription

      public String getDescription()
      Gets the column description.
      Returns:
      A description, or null for none.
    • getBestVSFieldValueType

      public Value.Type getBestVSFieldValueType(VSRelativeReference<?> reference)
      Requests the value type that would best suit the listener.
      Specified by:
      getBestVSFieldValueType in interface IVSFieldListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      Returns:
      null if none is available.
    • onResolved

      public void onResolved(VSRelativeReference<?> reference, VSField field)
      Called when the property reference has been resolved. UI components use this method to set its state according to the field.
      Specified by:
      onResolved in interface IVSFieldListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      field - The target reference.
    • onBroken

      public void onBroken(VSRelativeReference<?> reference, VSField field)
      Called when the property reference has been broken, i.e. unresolved.
      Specified by:
      onBroken in interface IVSFieldListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      field - The target reference.
    • onStateChanged

      public void onStateChanged(VSField field, IVSComponentState.State state, boolean on)
      Called when the field changes state.
      Specified by:
      onStateChanged in interface IVSFieldListener
      Parameters:
      field - The VS field.
      state - The state change.
      on - New state.
    • onParentStateChanged

      public void onParentStateChanged(IVSComponent parent, IVSComponentState.State state, boolean on)
      Called when the column changes state.
      Specified by:
      onParentStateChanged in interface IVSComponentListener
      Parameters:
      parent - The parent who's state was changed.
      state - The state change, possible values PARENT_ENABLED, PARENT_READONLY, PARENT_VISIBLE.
      on - New state.
    • onValueChanged

      public void onValueChanged(VSField field, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)
      Called when the field value is set.
      Specified by:
      onValueChanged in interface IVSFieldListener
      Parameters:
      field - The VS field.
      value - The value, never null, but value.isNull() could be true.
      trigger - The trigger property that may be null.
      postProcessing - Post-processing instance.