Tabnine Logo
StructuredNode.compile
Code IndexAdd Tabnine to your IDE (free)

How to use
compile
method
in
sirius.kernel.xml.StructuredNode

Best Java code snippets using sirius.kernel.xml.StructuredNode.compile (Showing top 3 results out of 315)

origin: com.scireum/sirius-kernel

/**
 * Returns a given node at the relative path.
 *
 * @param xpath the xpath used to retrieve the resulting node
 * @return the node returned by the given xpath expression
 * @throws IllegalArgumentException if an invalid xpath was given
 */
@Nullable
public StructuredNode queryNode(String xpath) {
  try {
    Node result = (Node) compile(xpath).evaluate(node, XPathConstants.NODE);
    if (result == null) {
      return null;
    }
    return new StructuredNode(result);
  } catch (XPathExpressionException e) {
    throw new IllegalArgumentException(e);
  }
}
origin: com.scireum/sirius-kernel

/**
 * Returns the property at the given relative path as string.
 *
 * @param path the xpath used to retrieve property
 * @return a string representation of the value returned by the given xpath expression
 * @throws IllegalArgumentException if an invalid xpath was given
 */
@Nullable
public String queryString(String path) {
  try {
    Object result = compile(path).evaluate(node, XPathConstants.NODE);
    if (result == null) {
      return null;
    }
    if (result instanceof Node) {
      String s = ((Node) result).getTextContent();
      if (s != null) {
        return s.trim();
      }
      return s;
    }
    return result.toString().trim();
  } catch (XPathExpressionException e) {
    throw new IllegalArgumentException(e);
  }
}
origin: com.scireum/sirius-kernel

/**
 * Returns a list of nodes at the relative path.
 *
 * @param xpath the xpath used to retrieve the resulting nodes
 * @return the list of nodes returned by the given xpath expression
 * @throws IllegalArgumentException if an invalid xpath was given
 */
@Nonnull
public List<StructuredNode> queryNodeList(String xpath) {
  try {
    NodeList result = (NodeList) compile(xpath).evaluate(node, XPathConstants.NODESET);
    List<StructuredNode> resultList = new ArrayList<>(result.getLength());
    for (int i = 0; i < result.getLength(); i++) {
      resultList.add(new StructuredNode(result.item(i)));
    }
    return resultList;
  } catch (XPathExpressionException e) {
    throw new IllegalArgumentException(e);
  }
}
sirius.kernel.xmlStructuredNodecompile

Popular methods of StructuredNode

  • queryString
    Returns the property at the given relative path as string.
  • queryValue
    Queries a sirius.kernel.commons.Value by evaluating the given xpath.
  • <init>
    Wraps the given node
  • getChildren
    Returns a list of all children of this DOM node.
  • getNode
    Returns the underlying W3C Node.
  • of
    Wraps the given W3C node into a structured node.
  • queryNode
    Returns a given node at the relative path.
  • serializeNodeAsXML
  • toString
  • visit
    Iterates through the sub-tree and invokes the appropriate handler for each child node.

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JTable (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now