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

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


          ComplexTypeSG complexTypeSG = typeSG.getComplexTypeSG();
          complexTypeSG.getXMLImplementation(pSource);
        }
      } else if (particle.isGroup()) {
        // TODO: Implement groups referencing groups
        throw new LocSAXException("Nested groups are yet unsupported", particle.getLocator());
      } else if (particle.isWildcard()) {
        // TODO: Implement Wildcard handling
        throw new LocSAXException("Wildcard handling is not implemented", particle.getLocator());
      } else {
        throw new IllegalStateException("Unknown particle type: Neither of element, group, or wildcard");
      }
    }
    log.finest(mName, "<-");
View Full Code Here


  }

  public void addParticle(XSParticle pParticle) throws SAXException {
    if (isAll()) {
      if (pParticle.getMaxOccurs() == -||  pParticle.getMaxOccurs() > 1) {
        throw new LocSAXException("Illegal 'maxOccurs' value inside 'all' group: " + pParticle.getMaxOccurs(),
                                     pParticle.getLocator());
      }
    }
    if (pParticle.getMaxOccurs() != -&&  pParticle.getMaxOccurs() < pParticle.getMinOccurs()) {
      throw new LocSAXException("Illegal 'maxOccurs' value, which is lower than 'minOccurs' value: " +
                                   pParticle.getMaxOccurs() + " < " + pParticle.getMinOccurs(),
                                   pParticle.getLocator());
    }
    particles.add(pParticle);
  }
View Full Code Here

    return (XSParticle[]) particles.toArray(new XSParticle[particles.size()]);
  }

  public void validate() throws SAXException {
    if (isChoice()  &&  particles.size() == 0) {
      throw new LocSAXException("A 'choice' model group must have at least one 'group', 'any', or 'element'.",
                                   getLocator());
    }
    for (Iterator iter = particles.iterator();  iter.hasNext()) {
      XSParticle particle = (XSParticle) iter.next();
      if (particle.isElement()) {
View Full Code Here

          for (int k = 0;  k < childs.length;  k++) {
            if (pClass.isAssignableFrom(childs[k].getClass())) {
              if (result == null) {
                result = childs[k];
              } else {
                throw new LocSAXException("Multiple instances of " + pClass.getName() +
                                           " in xs:annotation/xs:appinfo are forbidden.",
                                           appinfos[j].getLocator());
              }
            }
          }
View Full Code Here

    super(pParent);
  }

  public void setValue(long pValue) throws SAXException {
    if (pValue < 0) {
      throw new LocSAXException("The 'value' attribute must not be negative.", getLocator());
    }
    value = pValue;
  }
View Full Code Here

  }

  public void validate() throws SAXException {
    super.validate();
    if (value == -1) {
      throw new LocSAXException("Missing 'value' attribute.", getLocator());
    }
  }
View Full Code Here

    if (names != null) {
      for (int i = 0;  i < names.length;  i++) {
        XsQName name = names[i];
        XSType type = pOwner.getXSSchema().getType(name);
        if (type == null) {
          throw new LocSAXException("Unknown member type: " + name, pBaseUnion.getLocator());
        }
        type.validate();
        if (!type.isSimple()) {
          throw new LocSAXException("The member type " + name + " is complex.",
                                       pBaseUnion.getLocator());
        }
        memberTypes.add(type);
      }
    }
    XsTLocalSimpleType[] simpleTypes = pBaseUnion.getSimpleTypes();
    if (simpleTypes != null) {
      for (int i = 0;  i < simpleTypes.length;  i++) {
        XsTLocalSimpleType localSimpleType = simpleTypes[i];
        XSType type = pOwner.getXSSchema().getXSObjectFactory().newXSType(pOwner, localSimpleType);
        type.validate();
        memberTypes.add(type);
      }
    }
    if (memberTypes.size() == 0) {
      throw new LocSAXException("Neither the 'memberTypes' attribute nor the 'simpleType' child elements did define a member type.",
                                   pBaseUnion.getLocator());
    }
  }
View Full Code Here

    return attrDecls.getAllAttributes();
  }

  public void validate() throws SAXException {
    if (!otherContent  &&  (simpleContent == null  &&  complexContent == null)) {
      throw new LocSAXException("You must specify either of the 'simpleContent', 'complexContent', 'all', 'choice', 'sequence', or 'group' child elements.",
                                 owner.getLocator());
    }
  }
View Full Code Here

          }
          t.printStackTrace();
          throw te;
        }
      }
      throw new LocSAXException(ex.getClass().getName() + ": " + ex.getMessage(),
                                 parser.getData().getLocator(), ex);
    }
  }
View Full Code Here

  }

  public void validate() throws SAXException {
    super.validate();
    if (getName() == null) {
      throw new LocSAXException("Missing attribute: 'name'", getLocator());
    }
    if (getPublic() == null) {
      throw new LocSAXException("Missing attribute: 'public'", 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.