Tabnine Logo
LocationPath
Code IndexAdd Tabnine to your IDE (free)

How to use
LocationPath
in
org.jaxen.expr

Best Java code snippets using org.jaxen.expr.LocationPath (Showing top 20 results out of 315)

origin: pmd/pmd

if (locationPath.isAbsolute()) {
  final List<Step> steps = locationPath.getSteps();
          allNodeStep.addPredicate(predicate);
        relativeLocationPath.addStep(allNodeStep);
          relativeLocationPath.addStep(steps.get(i));
        final BaseXPath xpath = createXPath(relativeLocationPath.getText(), navigator);
        addQueryToNode(xpath, ((NameStep) step2).getLocalName());
        valid = true;
origin: jaxen/jaxen

public String getText() {
  StringBuffer buf = new StringBuffer();
  if (getFilterExpr() != null) {
    buf.append(getFilterExpr().getText());
  }
  if (getLocationPath() != null) {
    if (!getLocationPath().getSteps().isEmpty()) buf.append("/");
    buf.append(getLocationPath().getText());
  }
  return buf.toString();
}
origin: jaxen/jaxen

List steps = locationPath.getSteps();
if ( locationPath.isAbsolute() )
origin: deegree/deegree3

private QName getChildElementStepAsQName( ValueReference ref ) {
  QName qName = null;
  Expr xpath = ref.getAsXPath();
  if ( xpath instanceof LocationPath ) {
    LocationPath lpath = (LocationPath) xpath;
    if ( lpath.getSteps().size() == 1 ) {
      if ( lpath.getSteps().get( 0 ) instanceof NameStep ) {
        NameStep step = (NameStep) lpath.getSteps().get( 0 );
        if ( isChildElementStepWithoutPredicateOrWithNumberPredicate( step ) ) {
          String prefix = step.getPrefix();
          if ( prefix.isEmpty() ) {
            qName = new QName( step.getLocalName() );
          } else {
            String ns = ref.getNsContext().translateNamespacePrefixToUri( prefix );
            qName = new QName( ns, step.getLocalName(), prefix );
          }
          LOG.debug( "QName: " + qName );
        }
      }
    }
  }
  return qName;
}
origin: jaxen/jaxen

protected void addSteps(LocationPath locationPath,
           Iterator stepIter)
{
  while ( stepIter.hasNext() )
  {
    locationPath.addStep( (Step) stepIter.next() );
  }
}
origin: deegree/deegree3

if ( lpath.getSteps().size() == 1 ) {
  if ( lpath.getSteps().get( 0 ) instanceof NameStep ) {
    NameStep step = (NameStep) lpath.getSteps().get( 0 );
    if ( step.getAxis() == Axis.CHILD && step.getPredicates().isEmpty()
       && !step.getLocalName().equals( "*" ) ) {
origin: deegree/deegree3

private QName getName( ValueReference path ) {
  if ( path.getAsQName() != null ) {
    return path.getAsQName();
  }
  Expr xpath = path.getAsXPath();
  if ( xpath instanceof LocationPath ) {
    LocationPath lp = (LocationPath) xpath;
    if ( lp.getSteps().size() == 1 && !lp.isAbsolute() ) {
      Step step = (Step) lp.getSteps().get( 0 );
      if ( step instanceof NameStep ) {
        return getQName( (NameStep) step );
      }
    }
  }
  return null;
}
origin: org.mycore/mycore-xeditor

@SuppressWarnings("unchecked")
public String getElementNameWithPredicates() throws JaxenException {
  BaseXPath baseXPath = new BaseXPath(xPath, new DocumentNavigator());
  Expr rootExpr = baseXPath.getRootExpr();
  LocationPath locationPath = (LocationPath) rootExpr;
  List<Step> steps = locationPath.getSteps();
  Step lastStep = steps.get(steps.size() - 1);
  return MCRNodeBuilder.simplify(lastStep.getText());
}
origin: net.sourceforge.pmd/pmd-core

if (locationPath.isAbsolute()) {
  final List<Step> steps = locationPath.getSteps();
          allNodeStep.addPredicate(predicate);
        relativeLocationPath.addStep(allNodeStep);
          relativeLocationPath.addStep(steps.get(i));
        final BaseXPath xpath = createXPath(relativeLocationPath.getText(), navigator);
        addQueryToNode(xpath, ((NameStep) step2).getLocalName());
        valid = true;
origin: deegree/deegree3

if ( xpath instanceof LocationPath ) {
  LocationPath lp = (LocationPath) xpath;
  if ( lp.getSteps().size() != 1 ) {
    LOG.warn( "Unhandled location path: '" + particleMapping.getPath()
         + "'. Only single step paths are handled." );
    continue;
  if ( lp.isAbsolute() ) {
    LOG.warn( "Unhandled location path: '" + particleMapping.getPath()
         + "'. Only relative paths are handled." );
    continue;
  Step step = (Step) lp.getSteps().get( 0 );
  if ( !step.getPredicates().isEmpty() ) {
    List<?> predicates = step.getPredicates();
origin: deegree/deegree3

public static List<QName> extractQNames( XPath xpath ) {
  List<QName> list = new ArrayList<QName>();
  try {
    Expr expr = new BaseXPath( xpath.getXPath(), null ).getRootExpr();
    if ( expr instanceof LocationPath ) {
      LocationPath lp = (LocationPath) expr;
      for ( Object o : lp.getSteps() ) {
        findQName( list, (Step) o, xpath.getNamespaceContext() );
      }
    }
  } catch ( JaxenException e ) {
    // not a proper xpath
  }
  return list;
}
origin: org.mycore/mycore-xeditor

private Element createRootElement(String xPath) throws JaxenException {
  BaseXPath baseXPath = new BaseXPath(xPath, new DocumentNavigator());
  LocationPath lp = (LocationPath) (baseXPath.getRootExpr());
  NameStep nameStep = (NameStep) (lp.getSteps().get(0));
  String prefix = nameStep.getPrefix();
  Namespace ns = prefix.isEmpty() ? Namespace.NO_NAMESPACE : MCRConstants.getStandardNamespace(prefix);
  return new Element(nameStep.getLocalName(), ns);
}
origin: deegree/deegree3

if ( !( lhs instanceof LocationPath ) || ( (LocationPath) lhs ).getSteps().size() != 1
   || !( ( (LocationPath) lhs ).getSteps().get( 0 ) instanceof NameStep )
   || ( (NameStep) ( (LocationPath) lhs ).getSteps().get( 0 ) ).getAxis() != ATTRIBUTE
   || !( (NameStep) ( (LocationPath) lhs ).getSteps().get( 0 ) ).getLocalName().equals( "name" ) ) {
  String msg = "Unable to map PropertyName '" + propName.getAsText()
         + "'. Slot steps must specify a single name predicate (../rim:Slot[@name=...]).";
origin: deegree/deegree3

for ( Object o : ( (LocationPath) path ).getSteps() ) {
  if ( o instanceof NameStep ) {
    NameStep step = (NameStep) o;
origin: org.milyn/milyn-smooks-all

List<Step> steps = path.getSteps();
origin: org.virtuslab/milyn-smooks-core

List<Step> steps = path.getSteps();
origin: org.milyn/milyn-smooks-core

List<Step> steps = path.getSteps();
origin: smooks/smooks

List<Step> steps = path.getSteps();
origin: org.dhatim/milyn-smooks-core

List<Step> steps = path.getSteps();
origin: org.dhatim/milyn-smooks-core

List<Step> steps = locationPath.getSteps();
org.jaxen.exprLocationPath

Javadoc

Represents an XPath location path such as //foo/bar or pre:baz[position()=last()]. This is production 1 in the XPath 1.0 specification:
[1]  LocationPath ::= RelativeLocationPath     
| AbsoluteLocationPath

Most used methods

  • getSteps
    Returns the ordered list of steps in this location path. This list may be live.
  • isAbsolute
    Returns true if this is an absolute location path; false if it isn't. Absolute location paths all be
  • addStep
    Add the next step to this location path.
  • getText
  • evaluate
  • simplify

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top Sublime Text plugins
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