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

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


    }
  }

  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 getStruct(TreeGrid treeGrid, TreeNode rootNode,
      Struct parent) {
    Struct current = null;
    if (Main.Sequence.equals(rootNode.getAttribute(Type))) {
      current = new StructSequenceImpl(rootNode.getAttribute(Name));
      ((StructSequenceImpl) current).setDelimiter(handleEscape(rootNode
          .getAttribute(Delimiter)));
      ((StructSequenceImpl) current).setLookahead(handleEscape(rootNode
          .getAttribute(Lookahead)));
View Full Code Here

    } else {
      XSGroup group = element.getType().getComplexType().getParticle()
          .getGroup();

      if ("sequence".equals("" + group.getCompositor())) {
        current = new StructSequenceImpl(element.getName()
            .getLocalName());
      } else if ("choice".equals("" + group.getCompositor())) {
        current = new StructChoiceImpl(element.getName().getLocalName());
      } else if ("all".equals("" + group.getCompositor())) {
        throw new RuntimeException("'all' is not supported yet");
View Full Code Here

public class Test {
 
  static String msg = "xxxxxx1111144444444455555555\r\nxxxxxxxxYYYYYYYYY\r\nxxxxxx1111144444444455555555\r\nxxxxxxxxYYYYYYYYY\r\nxxxxxxxxxxxxyyyyy";
  public static void main1(String[] args) throws ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException {
    StructSequence root = new StructSequenceImpl("root");
    root.setDelimiter("\r\n");
    StructSequenceImpl ab = new StructSequenceImpl("ab");
    ab.setDelimiter("\r\n");
    ab.setMinOccurrences(1).setMaxOccurrences(2);
    StructSequence a = new StructSequenceImpl("a");
    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 =
        (DOMImplementationLS)registry.getDOMImplementation("LS");
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

    } else {
      XSGroup group = element.getType().getComplexType().getParticle()
          .getGroup();

      if ("sequence".equals("" + group.getCompositor())) {
        current = new StructSequenceImpl(element.getName()
            .getLocalName());
        mandatory = handleSequence((StructSequence) current, element);
      } else if ("choice".equals("" + group.getCompositor())) {
        current = new StructChoiceImpl(element.getName().getLocalName());
      } else if ("all".equals("" + group.getCompositor())) {
View Full Code Here

TOP

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

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.