Examples of XSType


Examples of org.apache.ws.jaxme.xs.XSType

        }
        XsQName base = restriction.getBase();
        if (base == null) {
          throw new LocSAXException("Invalid 'restriction': Missing 'base' attribute", getLocator());
        }
        XSType type = getXSSchema().getType(base);
        if (type == null) {
          throw new LocSAXException("Invalid 'restriction': Unknown base type " + base, getLocator());
        }
        if (type.isSimple()) {
          throw new LocSAXException("Invalid 'restriction': The base type " + getName() + " is simple.", getLocator());
        }
        XsTTypeDefParticle particle = restriction.getTypeDefParticle();

        XSGroup group = getGroupByParticle(particle);
        if (group == null) {
          // TODO: Restriction of the ur-type
          complexContentParticle = null;
        } else {
          complexContentParticle = new XSParticleImpl(group);
        }
        complexContentType = getContentTypeByParticle(particle, group);
        attributes = XSAttributeGroupImpl.getAttributes(XSTypeImpl.this, restriction);
        restrictedType = type;
      } else {
        XsQName base = extension.getBase();
        if (base == null) {
          throw new LocSAXException("Invalid 'extension': Missing 'base' attribute", getLocator());
        }
        XSType type = getXSSchema().getType(base);
        if (type == null) {
          throw new LocSAXException("Invalid 'extension': Unknown base type " + base, getLocator());
        }
        if (type.isSimple()) {
          throw new LocSAXException("Invalid 'extension': The base type " + base + " is simple.", getLocator());
        }
        XSComplexType extendedComplexType = type.getComplexType();
        if (extendedComplexType.hasSimpleContent()) {
          throw new LocSAXException("Invalid 'extension': The base type " + base + " has simple content.",
                                       getLocator());
        }
        XsTTypeDefParticle particle = extension.getTypeDefParticle();
View Full Code Here

Examples of org.apache.ws.jaxme.xs.XSType

      }
    }

    if (theChild == null) {
      // We have to create a new attribute matching the column
      XSType xsType;
      if (pColumn.isBinaryColumn()) {
        xsType = XSBase64Binary.getInstance();
      } else if (pColumn.isStringColumn()) {
        xsType = XSString.getInstance();
      } else {
View Full Code Here

Examples of org.apache.ws.jaxme.xs.XSType

  public XSType[] getBuiltinTypes() {
    return BUILTIN_TYPES;
  }

  public XSType getType(XsQName pName) {
    XSType result = (XSType) types.get(pName);
    if (result == null) {
      result = (XSType) builtinTypes.get(pName);
    }
    return result;
  }
View Full Code Here

Examples of org.apache.ws.jaxme.xs.XSType

      XsTLocalSimpleType simpleType = pBaseList.getSimpleType();
      if (simpleType == null) {
        throw new LocSAXException("You must either set the 'itemType' attribute or add a 'simpleType' element.",
                                   pBaseList.getLocator());
      }
      XSType type = pOwner.getXSSchema().getXSObjectFactory().newXSType(pOwner, simpleType);
      type.validate();
      itemType = type;
    } else {
      XSType type = pOwner.getXSSchema().getType(itemTypeName);
      if (type == null) {
        throw new LocSAXException("Unknown item type: " + itemTypeName, pBaseList.getLocator());
      }
      type.validate();
      if (!type.isSimple()) {
        throw new LocSAXException("The item type " + itemTypeName + " is complex.",
                                     pBaseList.getLocator());
      }
      itemType = type;
    }
View Full Code Here

Examples of org.apache.ws.jaxme.xs.XSType

  /** <p>Creates a new instance of JAXBSimpleContentSG.java.</p>
   */
  protected JAXBSimpleContentTypeSG(ComplexTypeSG pComplexTypeSG, XSType pType) throws SAXException {
    xsType = pType;
    typeSG = pComplexTypeSG.getTypeSG();
    XSType theSimpleType = pType.getComplexType().getSimpleContent().getType();
    contentTypeSG = typeSG.getFactory().getTypeSG(theSimpleType, pComplexTypeSG.getClassContext(), null);
  }
View Full Code Here

Examples of org.apache.ws.jaxme.xs.XSType

                          XsEUnion pBaseUnion) throws SAXException {
    XsQName[] names = pBaseUnion.getMemberTypes();
    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.",
View Full Code Here

Examples of org.apache.ws.jaxme.xs.XSType

    super(pFactory, pSchema, pType);
    name = pName;
    xsType = pType;
    if (pType.isSimple()) {
      if (pType.getSimpleType().isRestriction()) {
        XSType restrictedXsType = pType.getSimpleType().getRestrictedType();
        if (restrictedXsType.equals(pType)) {
          throw new IllegalStateException("Invalid restriction (equals this): " + pType);
        }
        restrictedType = pFactory.getTypeSG(restrictedXsType, pClassContext, restrictedXsType.getName());
        extendedType = null;
      } else {
        restrictedType = extendedType = null;
      }
    } else {
View Full Code Here

Examples of org.apache.ws.jaxme.xs.XSType

  public TypeSG getType(SchemaSG pController, XsQName pName) throws SAXException {
    TypeSG typeSG = (TypeSG) typesByName.get(pName);
    if (typeSG != null) {
      return typeSG;
    }
    XSType type = getXSSchema().getType(pName);
    if (type == null) {
      return null;
    }
    typeSG = pController.getFactory().getTypeSG(type);
    typesByName.put(pName, typeSG);
View Full Code Here

Examples of org.apache.ws.jaxme.xs.XSType

      XSAnnotation ann = getXSSchema().getXSObjectFactory().newXSAnnotation(this, xsAnnotation);
      annotations = new XSAnnotation[]{ ann };
      ann.validate();
    }

    XSType myType;
    if (isReference()) {
      XSAttribute attribute = getXSSchema().getAttribute(getName());
      if (attribute == null) {
        throw new LocSAXException("Invalid attribute reference: No type named " + getName() + " defined.",
                                     getXsTAttribute().getLocator());
      }
      myType = attribute.getType();
    } else if (isInnerSimpleType()) {
      XsTLocalSimpleType innerSimpleType = getXsTAttribute().getSimpleType();
      myType = getXSSchema().getXSObjectFactory().newXSType(this, innerSimpleType);
      myType.validate();
    } else {
      XsQName typeName = getXsTAttribute().getType();
      if (typeName == null) {
        typeName = XSAnySimpleType.getInstance().getName();
      }
View Full Code Here

Examples of org.apache.ws.jaxme.xs.XSType

    return result;
  }

  protected XSType assertRestriction(XSSimpleType pType) throws SAXException {
    assertTrue(pType.isRestriction());
    XSType result = pType.getRestrictedType();
    assertNotNull(result);
    assertSimpleType(result);
    return result;
  }
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.