Examples of SimpleTypeSG


Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

    ObjectSG e2 = elements[1];
    assertEquals(new XsQName((String) null, "b"), e2.getName());
    TypeSG t2 = e2.getTypeSG();
    assertTrue(!t2.isComplex());
    SimpleTypeSG st2 = t2.getSimpleTypeSG();
    assertTrue(st2.isAtomic());
    assertEquals(JavaQNameImpl.getInstance(float.class), st2.getRuntimeType());

    ObjectSG e3 = elements[2];
    assertEquals(new XsQName((String) null, "c"), e3.getName());
    TypeSG t3 = e3.getTypeSG();
    assertTrue(t3.isComplex());
    ComplexTypeSG ct3 = t3.getComplexTypeSG();
    assertTrue(!ct3.hasSimpleContent());
    ComplexContentSG cct3 = ct3.getComplexContentSG();
    ParticleSG[] childs = cct3.getRootParticle().getGroupSG().getParticles();
    assertEquals(2, childs.length);
    assertTrue(childs[0].isElement());
    ObjectSG child1 = childs[0].getObjectSG();
    assertEquals(new XsQName((String) null, "a"), child1.getName());
    assertTrue(childs[1].isElement());
    ObjectSG child2 = childs[1].getObjectSG();
    assertEquals(new XsQName((String) null, "d"), child2.getName());
    assertTrue(!child2.getTypeSG().isComplex());
    SimpleTypeSG st4 = child2.getTypeSG().getSimpleTypeSG();
    assertEquals(JavaQNameImpl.getInstance(double.class), st4.getRuntimeType());
    AttributeSG[] attributes = ct3.getAttributes();
    assertEquals(1, attributes.length);
    assertEquals(new XsQName((String) null, "e"), attributes[0].getName());
    assertTrue(!attributes[0].getTypeSG().isComplex());
View Full Code Here

Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

    ObjectSG[] elements = jschema.getElements();
    assertEquals(1, elements.length);
    ObjectSG se1 = elements[0];
    assertEquals(new XsQName((String) null, "a"), se1.getName());
    assertTrue(!se1.getTypeSG().isComplex());
    SimpleTypeSG sst1 = se1.getTypeSG().getSimpleTypeSG();
    assertEquals(JavaQNameImpl.getInstance(String.class), sst1.getRuntimeType());
    Facet facet = sst1.getFacet(Facet.ENUMERATION);
    assertNotNull(facet);
    String[] values = facet.getValues();
    assertNotNull(values);
    assertEquals(3, values.length);
    assertEquals("AK", values[0]);
View Full Code Here

Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

    SchemaSG jschema = parse(schema, "testNonPositiveInteger.xsd");

    // simple, atomic, with restriction and maxExclusive and maxInclusive
    TypeSG npi = jschema.getElements()[0].getTypeSG();
    assertTrue(!npi.isComplex());
    SimpleTypeSG npis = npi.getSimpleTypeSG();
    assertTrue(npis.isAtomic());
    assertTrue(!npis.isList());
    assertTrue(!npis.isUnion());
    assertEquals(new Long(0), npis.getAtomicType().getFractionDigits());
    assertEquals("0", npis.getAtomicType().getMaxInclusive());
    assertEquals("1", npis.getAtomicType().getMaxExclusive());
  }
View Full Code Here

Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

    SchemaSG jschema = parse(schema, "testNegativeInteger.xsd");

    // simple, atomic, with restrictions on maxInclusive and MaxExclusive
    TypeSG ni = jschema.getElements()[0].getTypeSG();
    assertTrue(!ni.isComplex());
    SimpleTypeSG nis = ni.getSimpleTypeSG();
    assertTrue(nis.isAtomic());
    assertTrue(!nis.isList());
    assertTrue(!nis.isUnion());
    assertEquals(new Long(0), nis.getAtomicType().getFractionDigits());
    assertEquals("-1", nis.getAtomicType().getMaxInclusive());
    assertEquals("0", nis.getAtomicType().getMaxExclusive());
  }
View Full Code Here

Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

    SchemaSG jschema = parse(schema, "testNonNegativeIntegerType.xsd");

    // simple, atomic, with restriction on minInclusive and minExclusive
    TypeSG nni = jschema.getElements()[0].getTypeSG();
    assertTrue(!nni.isComplex());
    SimpleTypeSG nnis = nni.getSimpleTypeSG();
    assertTrue(nnis.isAtomic());
    assertTrue(!nnis.isList());
    assertTrue(!nnis.isUnion());
    assertEquals(new Long(0), nnis.getAtomicType().getFractionDigits());
    assertEquals("-1", nnis.getAtomicType().getMinExclusive());
    assertEquals("0", nnis.getAtomicType().getMinInclusive());
  }
View Full Code Here

Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

    SchemaSG jschema = parse(schema, "testPositiveIntegerType.xsd");

    // simple, atomic, with restriction on minInclusive and minExclusive
    TypeSG pi = jschema.getElements()[0].getTypeSG();
    assertTrue(!pi.isComplex());
    SimpleTypeSG pis = pi.getSimpleTypeSG();
    assertTrue(pis.isAtomic());
    assertTrue(!pis.isList());
    assertTrue(!pis.isUnion());
    assertEquals(new Long(0), pis.getAtomicType().getFractionDigits());
    assertEquals("0", pis.getAtomicType().getMinExclusive());
    assertEquals("1", pis.getAtomicType().getMinInclusive());
  }
View Full Code Here

Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

    // simple, atomic, with restriction on fractionDigits
    ObjectSG[] elements = jschema.getElements();
    TypeSG i = elements[0].getTypeSG();
    assertTrue(!i.isComplex());
    SimpleTypeSG is = i.getSimpleTypeSG();
    assertTrue(is.isAtomic());
    assertTrue(!is.isList());
    assertTrue(!is.isUnion());
    assertEquals(JavaQNameImpl.getInstance(BigInteger.class), is.getRuntimeType());
    assertEquals(new Long(0), is.getAtomicType().getFractionDigits());
  }
View Full Code Here

Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

    // list of one or more nmtoken's
    ObjectSG[] elements = jschema.getElements();
    assertEquals(1, elements.length);
    TypeSG nmts = elements[0].getTypeSG();
    assertTrue(!nmts.isComplex());
    SimpleTypeSG nmtss = nmts.getSimpleTypeSG();
    assertTrue(!nmtss.isAtomic());
    assertTrue(nmtss.isList());
    assertTrue(!nmtss.isUnion());
    ListTypeSG nmtsl = nmtss.getListType();
    assertEquals(new Long(1), nmtsl.getMinLength());
 
View Full Code Here

Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

                }
                TypeSG type = pSchema.getType(simpleType.getRestrictedType().getName());
                runtimeType = type.getSimpleTypeSG().getRuntimeType();
                result = newAtomicTypeRestriction(pController, pFactory, pSchema, pType);
            } else {
                SimpleTypeSG simpleTypeSG = new SimpleTypeSGImpl(result);
                simpleTypeSG.init();
              runtimeType = simpleTypeSG.getRuntimeType();
            }
            if (javaType == null) {
                JAXBJavaType[] globalJavaTypes = pSchema.getJAXBJavaTypes();
                for (int i = 0;  i < globalJavaTypes.length;  i++) {
                  if (runtimeType.equals(globalJavaTypes[i].getName())) {
View Full Code Here

Examples of org.apache.ws.jaxme.generator.sg.SimpleTypeSG

    TypeSG[] st = schemaSG.getTypes();
    assertEquals(3, st.length);

    TypeSG st1 = st[0];
    assertTrue(!st1.isComplex());
    SimpleTypeSG sst1 = st1.getSimpleTypeSG();
    assertTrue(sst1.isAtomic());
    assertTrue(!sst1.isList());
    assertTrue(!sst1.isUnion());
    assertEquals(sst1.getRuntimeType(), JavaQNameImpl.getInstance(String.class));

    TypeSG st2 = st[1];
    assertTrue(!st2.isComplex());
    SimpleTypeSG sst2 = st2.getSimpleTypeSG();
    assertTrue(!sst2.isAtomic());
    assertTrue(sst2.isList());
    assertTrue(!sst2.isUnion());
    ListTypeSG lt = sst2.getListType();
    assertNotNull(lt.getItemType());
    TypeSG sst = lt.getItemType();
    assertTrue(!sst.isComplex());
    SimpleTypeSG it = sst.getSimpleTypeSG();
    assertEquals(JavaQNameImpl.INT, it.getRuntimeType());

    TypeSG st3 = st[2];
    assertEquals(false, st3.isComplex());
    SimpleTypeSG sst3 = st3.getSimpleTypeSG();
    assertEquals(false, sst3.isAtomic());
    assertEquals(false, sst3.isList());
    assertEquals(true, sst3.isUnion());
    UnionTypeSG ut = sst3.getUnionType();
    TypeSG[] uTypes = ut.getMemberTypes();
    assertEquals(2, uTypes.length);
  }
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.