Package org.apache.ws.jaxme.xs.parser.impl

Examples of org.apache.ws.jaxme.xs.parser.impl.LocSAXException


  public Object getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new DatatypeConverterImpl().parseHexBinary(pValue);
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to HexBinary: " + pValue, getLocator());
    }
  }
View Full Code Here


  public Object getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new DatatypeConverterImpl().parseBase64Binary(pValue);
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to Base64Binary: " + pValue, getLocator());
    }
  }
View Full Code Here

  public Object getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new Integer(new DatatypeConverterImpl().parseUnsignedShort(pValue));
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to unsigned short: " + pValue, getLocator());
    }
  }
View Full Code Here

  public Object getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new Long(new DatatypeConverterImpl().parseLong(pValue)) + "l";
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to long: " + pValue, getLocator());
    }
  }
View Full Code Here

  public Object getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new DatatypeConverterImpl().parseTime(pValue);
    } catch (RuntimeException e) {
      throw new LocSAXException("Failed to convert string value to time instance: " + pValue, getLocator());
    }
  }
View Full Code Here

  public Object getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new Double(new DatatypeConverterImpl().parseDouble(pValue));
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert string value to double: " + pValue, getLocator());
    }
  }
View Full Code Here

    Long length = atomicType.getLength();
    Long maxLength = atomicType.getMaxLength();
    Long minLength = atomicType.getMinLength();

    if (minLength != null  &&  minLength.longValue() < 0) {
      throw new LocSAXException("Negative value for minLength detected: " + minLength, getLocator());
    }
    if (maxLength != null) {
      if (maxLength.longValue() < 0) {
        throw new LocSAXException("Negative value for maxLength detected: " + maxLength, getLocator());
      }
      if (minLength != null) {
        if (maxLength.longValue() < minLength.longValue()) {
          throw new LocSAXException("MaxLength value of " + maxLength + " is smaller than minLength value of " + minLength,
                                     getLocator());
        }
        if (maxLength.longValue() == minLength.longValue()) {
          length = maxLength;
        }
      }
    }
    if (length != null) {
      if (length.longValue() < 0) {
        throw new LocSAXException("Negative value for length detected: " + length, getLocator());
      }
      if (maxLength != null) {
        if (maxLength.longValue() < length.longValue()) {
          throw new LocSAXException("MaxLength value of " + maxLength + " is smaller than length value of " + length,
                                     getLocator());
        }
        maxLength = null// Avoid unnecessary checks
      }
      if (minLength != null) {
        if (minLength.longValue() > length.longValue()) {
          throw new LocSAXException("MinLength value of " + minLength + " is larger than length value of " + length,
                                     getLocator());
        }
        minLength = null// Avoid unnecessary checks
      }
    }
View Full Code Here

  public Object getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new Object[]{"((", BYTE_TYPE, ") ", new Byte(new DatatypeConverterImpl().parseByte(pValue)), ")"};
    } catch (NumberFormatException e) {
      throw new LocSAXException("Failed to convert byte value to integer: " + pValue, getLocator());
    }
  }
View Full Code Here

      }

      for (int j = 0;  j < enums.size();  j++) {
        EnumValue ev = (EnumValue) enums.get(j);
        if (name.equals(ev.getName())) {
          throw new LocSAXException("An enumeration value named " + name + " already exists.", en.getLocator());
        }
        if (value.equals(ev.getValue())) {
          throw new LocSAXException("An enumeration value " + value + " already exists.", en.getLocator());
        }
      }
      enums.add(new EnumValue(value, name));
    }
    values = (EnumValue[]) enums.toArray(new EnumValue[enums.size()]);
View Full Code Here

          jaxbProperty = refAttr.getJAXBProperty();
        }
      }
    } else {
      if (isGlobal()  &&  jaxbProperty != null  &&  jaxbProperty.getBaseType() != null) {
        throw new LocSAXException("The element jaxb:property/jaxb:baseType is forbidden in global attributes." +
                                   " You may set it in the reference using the attribute locally. [JAXB 6.8.1.2.1]",
                                   jaxbProperty.getLocator());
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.parser.impl.LocSAXException

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.