Package com.dtrules.xmlparser.XMLTree

Examples of com.dtrules.xmlparser.XMLTree.Node


        boolean changes = false;
        boolean missingResults = false;
        File files[] = outputs.listFiles();
        for(File file : files){
            if(file.getName().endsWith("_results.xml")){
                Node result1=null, result2=null;
                try{
                    result1 = XMLTree.BuildTree(new FileInputStream(file),false,false);
                    result2 = XMLTree.BuildTree(new FileInputStream(getResultDirectory()+file.getName()),false, false);
                    if(result1 != null && result2 != null){
                        removeIds(result1);
View Full Code Here


    *
    */
   public static ArrayList<Node> findMissingNodes(String attribs[], ArrayList<Node> dts1, ArrayList<Node> dts2){
       ArrayList<Node> missing = new ArrayList<Node>();
       for(int i = dts1.size()-1; i>=0; i--){
           Node t1 = dts1.get(i);
           Node match = null;
           for(Node t2: dts2){
               boolean allmatch = true;
               for(String attrib : attribs){
                   if(!t1.getAttributes().get(attrib).equals(t2.getAttributes().get(attrib))){
                       allmatch = false;
View Full Code Here

    *
    */
   public static ArrayList<Node> findMissingNodes(String attrib, String tag, ArrayList<Node> dts1, ArrayList<Node> dts2){
       ArrayList<Node> missing = new ArrayList<Node>();
       for(int i = dts1.size()-1; i>=0; i--){
           Node t1 = dts1.get(i);
           String t1name = getName(t1,attrib);
           Node match = null;
           for(Node t2: dts2){
               String t2name = getName(t2,attrib);
              
               if(t1name.equals(t2name)){
                   match = t2;
View Full Code Here

       if(rules1.dts == null || rules2.dts == null){
           report.closetag();
           return;
       }

       Node root1 = rules1.getDtsRoot();
       Node root2 = rules2.getDtsRoot();


       ArrayList<Node> decisionTables1 = findtables(root1);
       ArrayList<Node> decisionTables2 = findtables(root2);
View Full Code Here

           }      
           report.closetag();
           return;
       }
      
       Node root1 = rules1.getEddRoot();
       Node root2 = rules2.getEddRoot();
      
       ArrayList<Node> entities1 = findentities(root1);
       ArrayList<Node> entities2 = findentities(root2);
      
       if(entities1.size()==0){
View Full Code Here

       if(rules1.mapping == null || rules2.mapping == null){
           report.closetag();
           return differences;
       }
  
       Node root1 = rules1.getMappingRoot();
       Node root2 = rules2.getMappingRoot();
       {       
           ArrayList<Node> attributes1 = findnodes("setattribute",root1,null);
           ArrayList<Node> attributes2 = findnodes("setattribute",root2,null);
          
           if(attributes1.size()==0){
View Full Code Here

        protected Node         mappingRoot   = null;
       
       
        private Node loadTree(InputStream s){
            try {
                Node root = XMLTree.BuildTree(s,false,false);
                return root;
            } catch (Exception e) {
                return null;
            }
           
View Full Code Here

    /**
     * Get the value for this attribute. So what we have to do is look through
     * the children of this object for a match for this attribute.
     */
    public Object get(Object obj) {
        Node xmlnode = (Node)obj;
        for (Node xmlchild : xmlnode.getTags()){
            String childtype = xmlchild.getAttributes().get("type");
            if(xmlchild.getName().equals(this.name)){
                if(childtype.equalsIgnoreCase("object") ){
                    if(xmlchild.getTags().size() > 0){
                        return xmlchild.getTags().get(0);
                    }
                }else if (type == MapType.LIST){
                    if(subType.isPrimitive()){
                        List<Object> ret = new ArrayList<Object>();
                        for(Node listItem : xmlchild.getTags()){
                            ret.add(listItem.getBody());
                        }
                        return ret;
                    }else{
                        return xmlchild.getTags();
                    }
                }else if (childtype.equalsIgnoreCase("int")
                     || childtype.equalsIgnoreCase("short")
                       || childtype.equalsIgnoreCase("integer")
                       || childtype.equalsIgnoreCase("long")
                       || childtype.equalsIgnoreCase("string")
                       || childtype.equalsIgnoreCase("boolean")
                       || childtype.equalsIgnoreCase("double")
                       || childtype.equalsIgnoreCase("date")){
                    String v = xmlchild.getBody();
                    return v;
                }else if (type == MapType.MAP){
                    Map<Object, Object> map = new HashMap<Object,Object>();
                    for(Node pair : xmlchild.getTags()){
                        Node keyNode   = pair.getTags().get(0);
                        Node valueNode = pair.getTags().get(1);
                        Object key = convert(keyNode);
                        Object value = convert(valueNode);
                        map.put(key, value);
                    }
                    return map;
View Full Code Here

        boolean changes = false;
        boolean missingResults = false;
        File files[] = outputs.listFiles();
        for(File file : files){
            if(file.getName().endsWith("_results.xml")){
                Node result1=null, result2=null;
                try{
                    result1 = XMLTree.BuildTree(new FileInputStream(file),false,false);
                    result2 = XMLTree.BuildTree(new FileInputStream(getResultDirectory(rs)+file.getName()),false, false);
                    if(result1 != null && result2 != null){
                        removeIds(result1);
View Full Code Here

        }
    }
   
    public void LoadXML(InputStream in){
        try {
            Node root = XMLTree.BuildTree(in, false, false);
            loadObjects(null,root);           
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of com.dtrules.xmlparser.XMLTree.Node

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.