Package org.geotools.filter

Examples of org.geotools.filter.ExpressionDOMParser


            } else if (childName.equalsIgnoreCase("SemanticTypeIdentifier")) {
                sti.add(getFirstChildValue(child));
            } else if (childName.equalsIgnoreCase("Rule")) {
                rules.add(parseRule(child));
            } else if (childName.equalsIgnoreCase("Transformation")) {
                ExpressionDOMParser parser = new ExpressionDOMParser(CommonFactoryFinder.getFilterFactory2(null));
                Expression tx = parser.expression(getFirstNonTextChild(child));
                ft.setTransformation(tx);
            }
        }

        if (sti.size() > 0) {
View Full Code Here


     * From the SLD 1.0 spec: "ParameterValueType" uses WFS-Filter expressions to give values for
     * SLD graphic parameters. A "mixed" element-content model is used with textual substitution for
     * values.
     */
    Expression parseParameterValueExpression(Node root, boolean mixedText) {
        ExpressionDOMParser parser = new ExpressionDOMParser((FilterFactory2) ff);
        Expression expr = parser.expression(root); // try the provided node first
        if (expr != null)
            return expr;
        NodeList children = root.getChildNodes();
        // if there is only one CharacterData node - we can make a literal out of it
        if (children.getLength() == 1 && root.getFirstChild() instanceof CharacterData) {
            Node textNode = root.getFirstChild();
            String text = textNode.getNodeValue();
            return ff.literal(text.trim());
        }
        List<Expression> expressionList = new ArrayList<Expression>();
        for (int index = 0; index < children.getLength(); index++) {
            Node child = children.item(index);
            if (child instanceof CharacterData) {
                if (mixedText) {
                    String text = child.getNodeValue();
                    Expression childExpr = ff.literal(text);
                    expressionList.add(childExpr);
                }
            } else {
                Expression childExpr = parser.expression(child);
                if (childExpr != null) {
                    expressionList.add(childExpr);
                }
            }
        }
View Full Code Here

      if  ( srsName != null)
      {
        parseSRS(srsName.getNodeValue());
      }
    }
      ExpressionDOMParser parser = new ExpressionDOMParser( CommonFactoryFinder.getFilterFactory2(null));
      return parser.gml( root );
  }
View Full Code Here

      } else if (childName.equalsIgnoreCase("SemanticTypeIdentifier")) {
        sti.add(getFirstChildValue(child));
      } else if (childName.equalsIgnoreCase("Rule")) {
        rules.add(parseRule(child));
      } else if (childName.equalsIgnoreCase("Transformation")) {
        ExpressionDOMParser parser = new ExpressionDOMParser(
            CommonFactoryFinder.getFilterFactory2(null));
        Expression tx = parser.expression(getFirstNonTextChild(child));
        ft.setTransformation(tx);
      }
    }

    if (sti.size() > 0) {
View Full Code Here

   * From the SLD 1.0 spec: "ParameterValueType" uses WFS-Filter expressions
   * to give values for SLD graphic parameters. A "mixed" element-content
   * model is used with textual substitution for values.
   */
  Expression parseParameterValueExpression(Node root, boolean mixedText) {
    ExpressionDOMParser parser = new ExpressionDOMParser(
        (FilterFactory2) ff);
    Expression expr = parser.expression(root); // try the provided node
                          // first
    if (expr != null)
      return expr;
    NodeList children = root.getChildNodes();
    // if there is only one CharacterData node - we can make a literal out
    // of it
    if (children.getLength() == 1
        && root.getFirstChild() instanceof CharacterData) {
      Node textNode = root.getFirstChild();
      String text = textNode.getNodeValue();
      return ff.literal(text.trim());
    }
    List<Expression> expressionList = new ArrayList<Expression>();
    for (int index = 0; index < children.getLength(); index++) {
      Node child = children.item(index);
      if (child instanceof CharacterData) {
        if (mixedText) {
          String text = child.getNodeValue();
          Expression childExpr = ff.literal(text);
          expressionList.add(childExpr);
        }
      } else {
        Expression childExpr = parser.expression(child);
        if (childExpr != null) {
          expressionList.add(childExpr);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.geotools.filter.ExpressionDOMParser

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.