Klasse DefaultValue

java.lang.Object
com.inet.report.DefaultValue
Alle implementierten Schnittstellen:
Serializable, Cloneable

public class DefaultValue extends Object implements Serializable, Cloneable
Holder for a PromptField's default value and its description. If the default value does not have a description, getDescription() will return null. The default value's "value" may be null.
Seit:
7.6
Siehe auch:
  • Konstruktordetails

    • DefaultValue

      protected DefaultValue(String description, int type)
      internal constructor
      Parameter:
      description - description of default value
      type - value type of default value
      Seit:
      11.0
    • DefaultValue

      public DefaultValue(Object value, String description, int type)
      Creates a DefaultValue with the given value and description. The object must be of a certain type, depending on the value type of the Prompt Field:
      • NUMBER : java.lang.Double
      • CURRENCY : java.lang.Double
      • BOOLEAN : java.lang.Boolean
      • DATE : java.sql.Date
      • TIME : java.sql.Time
      • DATETIME : java.sql.Timestamp
      • STRING : java.lang.String
      • Range : com.inet.report.FormulaRange
      Parameter:
      value - Value of the default value
      description - Description of the default value, can be null if there is no description
      type - field type of the prompt field to which this default value belongs
      Löst aus:
      IllegalArgumentException - if the field type does not match the object type or if the field type is unknown
      Seit:
      7.6
      Siehe auch:
    • DefaultValue

      public DefaultValue(Object value, String description)
      Creates a default value with field value type set as UNKNOWN
      Parameter:
      value - value of the default value
      description - description of the default value, may be null
      Seit:
      7.6
      Siehe auch:
  • Methodendetails

    • createDefaultValueFromFormula

      public static DefaultValue createDefaultValueFromFormula(String value, String description, Engine engine) throws ReportException
      Creates and returns a default value by parsing the given value string as a CC formula.
      Parameter:
      value - value as formula syntax
      description - description of the default value, can be null
      engine - engine used to parse the formula
      Gibt zurück:
      created default value
      Löst aus:
      ReportException - if an error occurs while parsing the formula
      Seit:
      7.6
    • createDefaultValueFromFormula

      public static DefaultValue createDefaultValueFromFormula(String value, String description, int valueType, Engine engine) throws ReportException
      Creates and returns a default value by parsing the given value string as a CC formula. Checks to make sure the formula's value type is the same as the value type given.
      Parameter:
      value - value as formula syntax
      description - description of the default value, can be null
      valueType - value type of the default value to be created.
      engine - engine used to parse the formula
      Gibt zurück:
      created default value
      Löst aus:
      ReportException - if an error occurs while parsing the formula
      Seit:
      7.6
    • createFormulaFieldDefaultValueFromFormula

      public static com.inet.report.FormulaDefaultValue createFormulaFieldDefaultValueFromFormula(FormulaField formulaField, String description, int valueType, Engine engine)
      creates and returns a default value based on the formula given. When a prompt is created with FormulaDefaultValues, the values are parsed at run-time, making it possible to have dynamically created yet "static" default values
      Parameter:
      formulaField - formula field to base default value on
      description - description of default value
      valueType - value type of default value
      engine - engine used to parse the formula
      Gibt zurück:
      created formula default value
      Seit:
      11.0
    • createBinaryDefaultValue

      public static DefaultValue createBinaryDefaultValue(String value, String description)
      Creates and returns a default value of value type Field.BINARY. The value string is parsed as a Base64 encoded byte array.
      Parameter:
      value - Base64-encoded byte array as string
      description - description of the default value, can be null
      Gibt zurück:
      Created default value
      Seit:
      7.6
    • getValue

      public Object getValue()
      Returns the value of this default value. Can be null. The type of this value depends on the type of the prompt field.
      • NUMBER : java.lang.Double
      • CURRENCY : java.lang.Double
      • BOOLEAN : java.lang.Boolean
      • DATE : java.sql.Date
      • TIME : java.sql.Time
      • DATETIME : java.sql.Timestamp
      • STRING : java.lang.String
      • Range : com.inet.report.FormulaRange
      Gibt zurück:
      Value of this default value. Can be null.
      Seit:
      7.6
      Siehe auch:
    • setValue

      public void setValue(Object value)
      Sets the value of this default value. Can be null. The type of the object allowed to be set depends of the type of the prompt field.
      • NUMBER : java.lang.Double
      • CURRENCY : java.lang.Double
      • BOOLEAN : java.lang.Boolean
      • DATE : java.sql.Date
      • TIME : java.sql.Time
      • DATETIME : java.sql.Timestamp
      • STRING : java.lang.String
      • Range : com.inet.report.FormulaRange
      Parameter:
      value - value to set.
      Seit:
      7.6
      Siehe auch:
    • getDescription

      public String getDescription()
      Returns the description of this default value. Will be null if there is no description for this DefaultValue.
      Gibt zurück:
      the description of this default value
      Seit:
      7.6
    • setDescription

      public void setDescription(String description)
      Sets the description of this default value. The description can be set to null which means this default value has not description
      Parameter:
      description - description to set for this default value
      Seit:
      7.6
    • getType

      public int getType()
      Returns the value type set in the constructor for this default value
      Gibt zurück:
      field value type of this default value.
      Seit:
      7.6
      Siehe auch:
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • clone

      public Object clone() throws CloneNotSupportedException
      Setzt außer Kraft:
      clone in Klasse Object
      Löst aus:
      CloneNotSupportedException