Package org.dmlite.exception

Examples of org.dmlite.exception.TypeException


                  .integer(propertyStringValue);
              if (propertyIntegerValue != null) {
                entity.setProperty(propertyCode,
                    propertyIntegerValue);
              } else {
                throw new TypeException("Not a valid Integer: "
                    + propertyStringValue + " ("
                    + conceptDotProperty + ")");
              }
            } else if (propertyClass == Long.class) {
              Long propertyLongValue = Transformer
                  .longInteger(propertyStringValue);
              if (propertyLongValue != null) {
                entity.setProperty(propertyCode,
                    propertyLongValue);
              } else {
                throw new TypeException(
                    "Not a valid Long (integer): "
                        + propertyStringValue + " ("
                        + conceptDotProperty + ")");
              }
            } else if (propertyClass == Float.class) {
              Float propertyFloatValue = Transformer
                  .floatDecimal(propertyStringValue);
              if (propertyFloatValue != null) {
                entity.setProperty(propertyCode,
                    propertyFloatValue);
              } else {
                throw new TypeException(
                    "Not a valid Float (decimal): "
                        + propertyStringValue + " ("
                        + conceptDotProperty + ")");
              }
            } else if (propertyClass == Double.class) {
              Double propertyDoubleValue = Transformer
                  .doubleDecimal(propertyStringValue);
              if (propertyDoubleValue != null) {
                entity.setProperty(propertyCode,
                    propertyDoubleValue);
              } else {
                throw new TypeException(
                    "Not a valid Double (decimal): "
                        + propertyStringValue + " ("
                        + conceptDotProperty + ")");
              }
            } else if (propertyClass == Boolean.class) {
              Boolean propertyBooleanValue = Transformer
                  .logic(propertyStringValue);
              if (propertyBooleanValue != null) {
                entity.setProperty(propertyCode,
                    propertyBooleanValue);
              } else {
                throw new TypeException("Not a valid Boolean: "
                    + propertyStringValue + " ("
                    + conceptDotProperty + ")");
              }
            } else if (propertyClass == Date.class) {
              String datePattern = entity.getConceptConfig()
                  .getContextModelConfig().getDatePattern();
              Date propertyDateValue = Transformer.date(
                  propertyStringValue, datePattern);
              if (propertyDateValue != null) {
                entity.setProperty(propertyCode,
                    propertyDateValue);
              } else {
                throw new TypeException("Not a valid Date: "
                    + propertyStringValue + " ("
                    + conceptDotProperty + ")");
              }
            } else if (propertyClass == URL.class) {
              URL propertyUrlValue = Transformer
                  .url(propertyStringValue);
              if (propertyUrlValue != null) {
                entity.setProperty(propertyCode,
                    propertyUrlValue);
              } else {
                throw new TypeException("Not a valid URL: "
                    + propertyStringValue + " ("
                    + conceptDotProperty + ")");
              }
            } else if (propertyClass == Email.class) {
              Email propertyEmailValue = Transformer
                  .email(propertyStringValue);
              if (propertyEmailValue != null) {
                entity.setProperty(propertyCode,
                    propertyEmailValue);
              } else {
                throw new TypeException("Not a valid Email: "
                    + propertyStringValue + " ("
                    + conceptDotProperty + ")");
              }
            } else {
              throw new TypeException(
                  "Property type not supported by dmLite: "
                      + propertyConfig.getPropertyClass());
            }
          }
        }
View Full Code Here


              String fieldValue = Transformer
                  .string(fieldEmailValue);
              element.addElement(propertyCode)
                  .addText(fieldValue);
            } else {
              throw new TypeException(
                  "Property type not supported by dmLite: "
                      + getObject);
            }
          } // if (getObject != null)
        }
View Full Code Here

TOP

Related Classes of org.dmlite.exception.TypeException

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.