Package Framework

Examples of Framework.DataValue


     * <p>
     * @param attr Type: int
     * @param value Type: DataValue
     */
    public void setAttrValue(int attr, DataValue value) {
        DataValue attrVal = null;

        attrVal = this.getAttr(attr);

        if (attrVal == null) {
            attrVal = this.newAttr(attr);
        }

        attrVal.setValue(value);
    }
View Full Code Here


    // ----------------------
    // Accessors and Mutators
    // ----------------------
    public void setElementKey(DataValue elementKey) {
        DataValue oldValue = this.elementKey;
        this.elementKey = elementKey;
        this.qq_Listeners.firePropertyChange("elementKey", oldValue, this.elementKey);
    }
View Full Code Here

    public DataValue getElementKey() {
        return this.elementKey;
    }

    public void setElementValue(DataValue elementValue) {
        DataValue oldValue = this.elementValue;
        this.elementValue = elementValue;
        this.qq_Listeners.firePropertyChange("elementValue", oldValue, this.elementValue);
    }
View Full Code Here

            else if (NumericData.class.isAssignableFrom(valueClass)) {
              Class<? extends NumericData>numericValueClass = (Class<? extends NumericData>)valueClass;
            try {
              // TF:10/4/08:Added in the scale of decimaldatas if necessary
              Object currentValue = this.docFilter.field.getValue();
          DataValue dataValue = FormatterUtils.createDataValueInstance(numericValueClass);
          if (currentValue instanceof DecimalData) {
            DecimalData originalValue = (DecimalData)currentValue;
            if (!originalValue.isNull() && dataValue instanceof DecimalData) {
              ((DecimalData)dataValue).setScale(originalValue.getScale());
            }
View Full Code Here

     */
    public String valueToString(Object value) throws ParseException {
      log.debug("valueToString(" + value + ")");

      if (value instanceof DataValue) {
        DataValue dataValue = (DataValue) value;
        Class<?> vc = this.getValueClass();
       
        //PM:7 oct. 2008:this is a special case for DateTimeNullable
        /*
         * if it is set to the beginning of the Gregorian calendar
         * the mask should contain '*'
         */
        if (DateTimeNullable.class.isAssignableFrom(vc)){
          DateTimeNullable dtn = (DateTimeNullable)value;
          if (dtn.asDate().getTime()==DateTimeData.GREGORIAN_START_AS_LONG){
            return super.valueToString(null);
          }
        }
       
        if (dataValue.isNullable() && dataValue.isNull()) {

          // TF+CraigM:19/08/2008 - Only set N/A if we are based on a TextData
          if (TextData.class.isAssignableFrom(vc)) {
            // TF:19/06/2008:Changed this to return N/A if the data field is null
            return "N/A";
View Full Code Here

                Logger.getLogger("task.part.logmgr").info("CopyRecordValues: Skipping copy; fromRecord and toRecord are the same object.");
            }
            return false;
        }

        DataValue fromValue = null;
        DataValue toValue = null;
        boolean didCopy = false;

        BusinessQuery tmpQry = fromRecord.newQuery();
        int lastDBAttr = tmpQry.getNumAttrs(BusinessQuery.ATTR_DB);

        for (int i = 1; i <= tmpQry.getNumAttrs(BusinessQuery.ATTR_SIMPLE); i++) {
            toValue = toRecord.getAttr(i);
            fromValue = fromRecord.getAttr(i);

            if ((toValue != null && fromValue != null && StringUtils.notEquals(toValue.getTextValue().toString(), fromValue.getTextValue().toString())) || (toValue == null && setIfNil)) {

                if (LogMgr.getInstance().test(Framework.Constants.SP_MT_DEBUG, Framework.Constants.SP_ST_EX, 30, 20)) {
                    Logger.getLogger("task.part.logmgr").info("Copying: fromValue.TextValue=");
                    if (fromValue != null) {
                        Logger.getLogger("task.part.logmgr").info(fromValue.getTextValue());
                    }
                    else {
                        Logger.getLogger("task.part.logmgr").info("NIL");
                    }
                    Logger.getLogger("task.part.logmgr").info("  -->  toValue.TextValue=");
                    if (toValue != null) {
                        Logger.getLogger("task.part.logmgr").info(toValue.getTextValue());
                    }
                    else {
                        Logger.getLogger("task.part.logmgr").info("NIL");
                    }
                }
View Full Code Here

    public void initializeDates(BusinessClass record, BusinessQuery template) {
        DateTimeNullable emptyDate = new DateTimeNullable();
        int recStat = record.getInstanceStatus();

        for (int i = 1; i <= template.getNumAttrs(BusinessQuery.ATTR_DB); i++) {
            DataValue attr = record.getAttr(i);
            if (attr != null && attr instanceof DateTimeNullable) {
                if (recStat == BusinessClass.ST_EMPTY || recStat == BusinessClass.ST_INSERT) {
                    this.getBusinessClient().logAttr(record, i);
                }
                if (((DateTimeNullable)attr).getIsNull() || ((DateTimeNullable)attr).isEqual(emptyDate).getValue()) {
View Full Code Here

    // ----------------------
    // Accessors and Mutators
    // ----------------------
    public void setValue(DataValue value) {
        DataValue oldValue = this.value;
        this.value = value;
        this.qq_Listeners.firePropertyChange("value", oldValue, this.value);
    }
View Full Code Here

    // ----------------------
    // Accessors and Mutators
    // ----------------------
    public void setValue(DataValue value) {
        DataValue oldValue = this.value;
        this.value = value;
        this.qq_Listeners.firePropertyChange("value", oldValue, this.value);
    }
View Full Code Here

   * The parameters can be IntegerData or TextData. The calling method must cast the result into the appropriate class type.
   * @param parameterName
   * @return
   */
  public Object getParameter(String parameterName) {
    DataValue item = (DataValue)this.table.find(parameterName);
    if (item == null) {
      UsageException errorVar = new UsageException("Error retrieving value for parameter named " + parameterName + ". No such parameter exists in the current ParameterList.");
      ErrorMgr.addError(errorVar);
      throw errorVar;
    }
View Full Code Here

TOP

Related Classes of Framework.DataValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.