Package com.xmlit.project.engine.struct.impl

Examples of com.xmlit.project.engine.struct.impl.StructSimpleImpl


  }

  public static void main(String[] args) throws SAXException,
      ParserConfigurationException, Exception {
    StructSequenceImpl root = new StructSequenceImpl("root");
    root.addChild(((StructSimple) new StructSimpleImpl("NewElement"))
        .setSimplePattern("/"));

    System.out.println(Struct2XSD.struct2XSD(XSD2Struct
        .xsd2Struct(Struct2XSD.struct2XSD(root))));
View Full Code Here


          .getAttributeAsBoolean(Not));

    } else if (Main.Choice.equals(rootNode.getAttribute(Type))) {
      current = new StructChoiceImpl(rootNode.getAttribute(Name));
    } else {
      current = new StructSimpleImpl(rootNode.getAttribute(Name));
      ((StructSimpleImpl) current).setSimplePattern(handleEscape(rootNode
          .getAttribute(Regex)));
      ((StructSimpleImpl) current).setAllowedChars(handleEscape(rootNode
          .getAttribute(AllowedChars)));
      ((StructSimpleImpl) current).setAllowedValues(handleEscape(rootNode
View Full Code Here

  }

  public static Struct readElement(XSElement element) throws Exception {
    Struct current = null;
    if (element.getType().isSimple()) {
      current = new StructSimpleImpl(element.getName().getLocalName());
      if (element.getType().getSimpleType().getPattern() != null) {
        String pattern = element.getType().getSimpleType().getPattern()[0][0];
        ((StructSimple) current)
            .setSimplePattern(handleUnEscape(pattern));
      } else {
View Full Code Here

    StructSequence b = new StructSequenceImpl("b");
    StructSequence c = new StructSequenceImpl("c");

    root.addChild(ab).addChild(c);
    ab.addChild(a).addChild(b);
    StructSimple x1 = new StructSimpleImpl("x1").setSimplePattern("[a-z]{6,9}")
    StructSimple y1 = new StructSimpleImpl("y1").setSimplePattern("[0-9]{5,9}");
    y1.setMaxOccurrences(10).setMinOccurrences(2);
    a.addChild(x1).addChild(y1);
   
    StructSimple x2 = new StructSimpleImpl("x2").setSimplePattern("[a-z]{6,9}")
    StructSimple y2 = new StructSimpleImpl("y2").setSimplePattern("[A-Z]{5,9}");
    b.addChild(x2).addChild(y2);
   
    StructSimple n = new StructSimpleImpl("n").setSimplePattern("[a-z]{6,9}")
    StructSimple m = new StructSimpleImpl("m").setSimplePattern("[a-z]{5,9}");
    c.addChild(n).addChild(m);
   
  //  n.setMinOccurrences(0);

    DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
View Full Code Here

 
  public static void main(String[] args) throws ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException {
    StructSequence root = new StructSequenceImpl("root");
    root.setDelimiter("/");
    StructSimple x1 = (StructSimple) new StructSimpleImpl("a").setSimplePattern("aaa").setMinOccurrences(1).setMaxOccurrences(1)
    StructSimple y1 = (StructSimple) new StructSimpleImpl("b").setSimplePattern("bbb").setMinOccurrences(1).setMaxOccurrences(1);
    root.addChild(x1).addChild(y1);

    DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();

    DOMImplementationLS impl =
View Full Code Here

  }

  public static void main(String[] args) throws SAXException,
      ParserConfigurationException, Exception {
    StructSequenceImpl root = new StructSequenceImpl("root");
    root.addChild(((StructSimple) new StructSimpleImpl("NewElement"))
        .setSimplePattern("/"));

    System.out.println(Struct2XSD.struct2XSD(XSD2Struct
        .xsd2Struct(Struct2XSD.struct2XSD(root))));
View Full Code Here

  public static Struct readElement(XSElement element) throws Exception {
    Struct current = null;
    boolean mandatory = true;
    if (element.getType().isSimple()) {
      current = new StructSimpleImpl(element.getName().getLocalName());
      mandatory = handleSimple((StructSimple) current, element);
      // System.out.println(element.getName() + "  "
      // +element.getType().getSimpleType().getPattern());
    } else {
      XSGroup group = element.getType().getComplexType().getParticle()
View Full Code Here

TOP

Related Classes of com.xmlit.project.engine.struct.impl.StructSimpleImpl

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.