Examples of DecimalPrecision


Examples of org.apache.chemistry.opencmis.commons.enums.DecimalPrecision

        } else if (propertyDefinition instanceof PropertyDecimalDefinition) {
            setIfNotNull(JSON_PROPERTY_TYPE_MIN_VALUE, ((PropertyDecimalDefinition) propertyDefinition).getMinValue(),
                    result);
            setIfNotNull(JSON_PROPERTY_TYPE_MAX_VALUE, ((PropertyDecimalDefinition) propertyDefinition).getMaxValue(),
                    result);
            DecimalPrecision precision = ((PropertyDecimalDefinition) propertyDefinition).getPrecision();
            if (precision != null) {
                result.put(JSON_PROPERTY_TYPE_PRECISION, precision.value());
            }
        } else if (propertyDefinition instanceof PropertyBooleanDefinition) {
        } else if (propertyDefinition instanceof PropertyDateTimeDefinition) {
            DateTimeResolution resolution = ((PropertyDateTimeDefinition) propertyDefinition).getDateTimeResolution();
            if (resolution != null) {
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.enums.DecimalPrecision

        } else if (propertyDefinition instanceof PropertyDecimalDefinition) {
            setIfNotNull(JSON_PROPERTY_TYPE_MIN_VALUE, ((PropertyDecimalDefinition) propertyDefinition).getMinValue(),
                    result);
            setIfNotNull(JSON_PROPERTY_TYPE_MAX_VALUE, ((PropertyDecimalDefinition) propertyDefinition).getMaxValue(),
                    result);
            DecimalPrecision precision = ((PropertyDecimalDefinition) propertyDefinition).getPrecision();
            if (precision != null) {
                result.put(JSON_PROPERTY_TYPE_PRECISION, precision.value());
            }
        } else if (propertyDefinition instanceof PropertyBooleanDefinition) {
            // nothing to do
        } else if (propertyDefinition instanceof PropertyDateTimeDefinition) {
            DateTimeResolution resolution = ((PropertyDateTimeDefinition) propertyDefinition).getDateTimeResolution();
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.enums.DecimalPrecision

        } else if (propertyDefinition instanceof PropertyDecimalDefinition) {
            setIfNotNull(JSON_PROPERTY_TYPE_MIN_VALUE, ((PropertyDecimalDefinition) propertyDefinition).getMinValue(),
                    result);
            setIfNotNull(JSON_PROPERTY_TYPE_MAX_VALUE, ((PropertyDecimalDefinition) propertyDefinition).getMaxValue(),
                    result);
            DecimalPrecision precision = ((PropertyDecimalDefinition) propertyDefinition).getPrecision();
            if (precision != null) {
                result.put(JSON_PROPERTY_TYPE_PRECISION, precision.value());
            }
        } else if (propertyDefinition instanceof PropertyBooleanDefinition) {
        } else if (propertyDefinition instanceof PropertyDateTimeDefinition) {
            DateTimeResolution resolution = ((PropertyDateTimeDefinition) propertyDefinition).getDateTimeResolution();
            if (resolution != null) {
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.enums.DecimalPrecision

        } else if (propertyDefinition instanceof PropertyDecimalDefinition) {
            setIfNotNull(JSON_PROPERTY_TYPE_MIN_VALUE, ((PropertyDecimalDefinition) propertyDefinition).getMinValue(),
                    result);
            setIfNotNull(JSON_PROPERTY_TYPE_MAX_VALUE, ((PropertyDecimalDefinition) propertyDefinition).getMaxValue(),
                    result);
            DecimalPrecision precision = ((PropertyDecimalDefinition) propertyDefinition).getPrecision();
            if (precision != null) {
                result.put(JSON_PROPERTY_TYPE_PRECISION, precision.value());
            }
        } else if (propertyDefinition instanceof PropertyBooleanDefinition) {
            // nothing to do
        } else if (propertyDefinition instanceof PropertyDateTimeDefinition) {
            DateTimeResolution resolution = ((PropertyDateTimeDefinition) propertyDefinition).getDateTimeResolution();
View Full Code Here

Examples of siena.core.DecimalPrecision

            // can't save it now as it requires its parent key to be mapped
            // so don't do anything for the time being
            continue;
          }*/
          else if (fieldClass == BigDecimal.class){
            DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
            if(ann == null) {
              value = ((BigDecimal)value).toPlainString();
            }else {
              switch(ann.storageType()){
              case DOUBLE:
                value = ((BigDecimal)value).doubleValue();
                break;
              case STRING:
              case NATIVE:
View Full Code Here

Examples of siena.core.DecimalPrecision

            }
          }
        }
      }
      else if(f.getType() == BigDecimal.class){
        DecimalPrecision ann = f.getAnnotation(DecimalPrecision.class);
        if(ann == null) {
          value = new BigDecimal((String)value);
        }else {
          switch(ann.storageType()){
          case DOUBLE:
            value = BigDecimal.valueOf((Double)value);
            break;
          case STRING:
          case NATIVE:
View Full Code Here

Examples of siena.core.DecimalPrecision

            continue;
          }
         
        }
        else if (fieldClass == BigDecimal.class){
          DecimalPrecision ann = f.getAnnotation(DecimalPrecision.class);
          if(ann == null) {
            propValue = ((BigDecimal)propValue).toPlainString();
          }else {
            switch(ann.storageType()){
            case DOUBLE:
              propValue = ((BigDecimal)propValue).doubleValue();
              break;
            case STRING:
            case NATIVE:
View Full Code Here

Examples of siena.core.DecimalPrecision

          return null;
        }
       
      }
      else if (type == BigDecimal.class){
        DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
        if(ann == null) {
          return ((BigDecimal)val).toPlainString();
        }else {
          switch(ann.storageType()){
          case DOUBLE:
            return ((Double)((BigDecimal)val).doubleValue()).toString();
          case STRING:
          case NATIVE:
            return ((BigDecimal)val).toPlainString();
View Full Code Here

Examples of siena.core.DecimalPrecision

      }
      else if (ClassInfo.isEmbeddedNative(field)) {
        return;
      }
      else if (fieldClass == BigDecimal.class){
        DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
        if(ann == null) {
          Util.setField(obj, field, new BigDecimal((String)val));
          return;
        }else {
          switch(ann.storageType()){
          case DOUBLE:
            // TODO add bigdecimal double lexicographic storage
            Util.setField(obj, field, new BigDecimal(val));
            return;
          case STRING:
View Full Code Here

Examples of siena.core.DecimalPrecision

          }
          else if(Enum.class.isAssignableFrom(type)){
            value = value.toString();
          }
          else if(BigDecimal.class == type){
            DecimalPrecision ann = field.getAnnotation(DecimalPrecision.class);
            if(ann == null) {
              value = (BigDecimal)value;
            }else {
              switch(ann.storageType()){
              case DOUBLE:
                value = ((BigDecimal)value).doubleValue();
                break;
              case STRING:
                value = ((BigDecimal)value).toPlainString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.