Package org.jboss.forge.parser.xml.query

Examples of org.jboss.forge.parser.xml.query.Pattern


                  .indexOf(ATTR_VALUE_SEPERATOR) + 1) : null;
         String attribute = path.indexOf(ATTR_PATH_SEPERATOR) != -1 ? path.substring(path.indexOf(ATTR_PATH_SEPERATOR)
                  + ATTR_PATH_SEPERATOR.length(), path.length()) : null;
         String[] attributes = attribute == null ? new String[0] : attribute.split(ATTR_SEPERATOR);

         Pattern pattern = new Pattern(name);
         pattern.text(text);
         for (String attr : attributes)
         {
            String[] nameValue = attr.split(ATTR_VALUE_SEPERATOR);
            if (nameValue.length != 2)
            {
               throw new IllegalArgumentException("Attribute without name or value found: " + attr + " in expression: "
                        + queryExpression);
            }
            pattern.attribute(nameValue[0], nameValue[1]);
         }
         patterns.add(pattern);
      }
      return patterns.toArray(ARRAY_CAST);
   }
View Full Code Here


                  .indexOf(ATTR_VALUE_SEPERATOR) + 1) : null;
         String attribute = path.indexOf(ATTR_PATH_SEPERATOR) != -1 ? path.substring(path.indexOf(ATTR_PATH_SEPERATOR)
                  + ATTR_PATH_SEPERATOR.length(), path.length()) : null;
         String[] attributes = attribute == null ? new String[0] : attribute.split(ATTR_SEPERATOR);

         Pattern pattern = new Pattern(name);
         pattern.text(text);
         for (String attr : attributes)
         {
            String[] nameValue = attr.split(ATTR_VALUE_SEPERATOR);
            if (nameValue.length != 2)
            {
               throw new IllegalArgumentException("Attribute without name or value found: " + attr + " in expression: "
                        + queryExpression);
            }
            pattern.attribute(nameValue[0], nameValue[1]);
         }
         patterns.add(pattern);
      }
      return patterns.toArray(ARRAY_CAST);
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.parser.xml.query.Pattern

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.