Package org.apache.ws.jaxme.xs

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


    XSAttributable[] xsAttributes = xsType.getComplexType().getAttributes();
    List attributeList = new ArrayList();
    for (int i = 0;  i < xsAttributes.length;  i++) {
      AttributeSGChain attrChain;
      if (xsAttributes[i] instanceof XSAttribute) {
        XSAttribute attr = (XSAttribute) xsAttributes[i];
        attrChain = (AttributeSGChain) pController.newAttributeSG(attr);
      } else if (xsAttributes[i] instanceof XSWildcard) {
        boolean isSupportingExtensions = false;
        SchemaReader schemaReader = pController.getTypeSG().getFactory().getGenerator().getSchemaReader();
        if (schemaReader instanceof JAXBSchemaReader) {
View Full Code Here


        } else {
          throw new IllegalStateException("Unknown column type: " + myType);
        }
      }

      XSAttribute attr = new JdbcAttribute(pType, pType.getLocator(),
                                           new XsQName((String) null, pColumn.getName().getName()), xsType,
                                           pColumn.isNullable());
      AttributeSGChain chain = (AttributeSGChain) pTypeSG.newAttributeSG(attr);
      AttributeSG attributeSG = new AttributeSGImpl(chain);
      pTypeSG.addAttributeSG(attributeSG);
View Full Code Here

  private static void dumpAttributable(
    XSAttributable attributable,
    String prefix
  ) throws SAXException {
    if ( attributable instanceof XSAttribute ) {
      XSAttribute attr = (XSAttribute) attributable;
      System.out.println(
        prefix + "attribute " + System.identityHashCode(attr) + ": "
        + attr.getName() + " "
        + (attr.getType().isSimple() ? "simple" : "complex!!!")
        + (attr.isOptional() ? " optional" : " required")
      );
    } else {
      System.out.println( prefix + "??? attrributable " + attributable );
    }
  }
View Full Code Here

            "  <xs:attribute name='id' type='xs:ID'/>\n" +
            "</xs:schema>\n";
        XSSchema schema = parse(schemaSpec, "jira46.xsd");
        XSAttribute[] attrs = schema.getAttributes();
        assertEquals(1, attrs.length);
        XSAttribute idAttr = attrs[0];
        assertEquals(new XsQName(uri, "id"), idAttr.getName());
        assertEquals(XSID.getInstance(), idAttr.getType());
        assertTrue(idAttr.isOptional());
        XSElement[] elements = schema.getElements();
        assertEquals(1, elements.length);
        XSElement rifElem = elements[0];
        XSComplexType ct = assertComplexType(rifElem.getType());
        XSAttributable[] rifAttrs = ct.getAttributes();
        assertEquals(1, rifAttrs.length);
        XSAttribute idRef = (XSAttribute) rifAttrs[0];
        assertFalse(idRef.equals(idAttr));
        assertEquals(new XsQName(uri, "id"), idAttr.getName());
        assertEquals(XSID.getInstance(), idAttr.getType());
        assertFalse(idRef.isOptional());
    }
View Full Code Here

    XSAttributable[] xsAttributes = xsType.getComplexType().getAttributes();
    List attributeList = new ArrayList();
    for (int i = 0;  i < xsAttributes.length;  i++) {
      AttributeSGChain attrChain;
      if (xsAttributes[i] instanceof XSAttribute) {
        XSAttribute attr = (XSAttribute) xsAttributes[i];
        attrChain = (AttributeSGChain) pController.newAttributeSG(attr);
      } else if (xsAttributes[i] instanceof XSWildcard) {
        boolean isSupportingExtensions = false;
        SchemaReader schemaReader = pController.getTypeSG().getFactory().getGenerator().getSchemaReader();
        if (schemaReader instanceof JAXBSchemaReader) {
View Full Code Here

    XSAttributable[] xsAttributes = xsType.getComplexType().getAttributes();
    List attributeList = new ArrayList();
    for (int i = 0;  i < xsAttributes.length;  i++) {
      AttributeSGChain attrChain;
      if (xsAttributes[i] instanceof XSAttribute) {
        XSAttribute attr = (XSAttribute) xsAttributes[i];
        attrChain = (AttributeSGChain) pController.newAttributeSG(attr);
      } else if (xsAttributes[i] instanceof XSWildcard) {
        boolean isSupportingExtensions = false;
        SchemaReader schemaReader = pController.getTypeSG().getFactory().getGenerator().getSchemaReader();
        if (schemaReader instanceof JAXBSchemaReader) {
View Full Code Here

            "  <xs:attribute name='id' type='xs:ID'/>\n" +
            "</xs:schema>\n";
        XSSchema schema = parse(schemaSpec, "jira46.xsd");
        XSAttribute[] attrs = schema.getAttributes();
        assertEquals(1, attrs.length);
        XSAttribute idAttr = attrs[0];
        assertEquals(new XsQName(uri, "id"), idAttr.getName());
        assertEquals(XSID.getInstance(), idAttr.getType());
        assertTrue(idAttr.isOptional());
        XSElement[] elements = schema.getElements();
        assertEquals(1, elements.length);
        XSElement rifElem = elements[0];
        XSComplexType ct = assertComplexType(rifElem.getType());
        XSAttributable[] rifAttrs = ct.getAttributes();
        assertEquals(1, rifAttrs.length);
        XSAttribute idRef = (XSAttribute) rifAttrs[0];
        assertFalse(idRef.equals(idAttr));
        assertEquals(new XsQName(uri, "id"), idAttr.getName());
        assertEquals(XSID.getInstance(), idAttr.getType());
        assertFalse(idRef.isOptional());
    }
View Full Code Here

        } else {
          throw new IllegalStateException("Unknown column type: " + myType);
        }
      }

      XSAttribute attr = new JdbcAttribute(pType, pType.getLocator(),
                                           new XsQName((String) null, pColumn.getName().getName()), xsType,
                                           pColumn.isNullable());
      AttributeSGChain chain = (AttributeSGChain) pTypeSG.newAttributeSG(attr);
      AttributeSG attributeSG = new AttributeSGImpl(chain);
      pTypeSG.addAttributeSG(attributeSG);
View Full Code Here

    XSAttributable[] xsAttributes = xsType.getComplexType().getAttributes();
    List attributeList = new ArrayList();
    for (int i = 0;  i < xsAttributes.length;  i++) {
      AttributeSGChain attrChain;
      if (xsAttributes[i] instanceof XSAttribute) {
        XSAttribute attr = (XSAttribute) xsAttributes[i];
        attrChain = (AttributeSGChain) pController.newAttributeSG(attr);
      } else if (xsAttributes[i] instanceof XSWildcard) {
        boolean isSupportingExtensions = false;
        SchemaReader schemaReader = pController.getTypeSG().getFactory().getGenerator().getSchemaReader();
        if (schemaReader instanceof JAXBSchemaReader) {
View Full Code Here

    XSSchema schema = pParser.parse(isource);

    XSAttributable[] attr = schema.getAttributes();
    assertEquals(3, attr.length);

    XSAttribute attr1 = (XSAttribute) attr[0];
    assertTrue(attr1.isGlobal());
    assertEquals(new XsQName((String) null, "a"), attr1.getName());
    XSType t1 = attr1.getType();
    assertEquals(XSString.getInstance(), t1);
    XSSimpleType st1 = assertSimpleType(attr1.getType());
    assertAtomicType(st1);

    XSAttribute attr2 = (XSAttribute) attr[1];
    assertTrue(attr2.isGlobal());
    assertEquals(new XsQName((String) null, "b"), attr2.getName());
    XSType t2 = attr2.getType();
    assertTrue(!XSInt.getInstance().equals(t2));
    XSType t2_1 = assertRestriction(assertSimpleType(t2));
    assertEquals(XSInt.getInstance(), t2_1);
    XSSimpleType st2 = assertSimpleType(t2);
    assertAtomicType(st2);

    XSAttribute attr3 = (XSAttribute) attr[2];
    assertTrue(attr3.isGlobal());
    assertEquals(new XsQName((String) null, "c"), attr3.getName());
    XSType t3 = attr3.getType();
    assertEquals(XSInt.getInstance(), t3);
    XSSimpleType st3 = assertSimpleType(t3);
    assertAtomicType(st3);
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.XSAttribute

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.