Tabnine Logo
JXPathIntrospector.registerDynamicClass
Code IndexAdd Tabnine to your IDE (free)

How to use
registerDynamicClass
method
in
org.apache.commons.jxpath.JXPathIntrospector

Best Java code snippets using org.apache.commons.jxpath.JXPathIntrospector.registerDynamicClass (Showing top 5 results out of 315)

origin: geotools/geotools

  protected boolean stream(ElementHandler handler) {
    // create an xpath context from the root element
    // TODO: cache the context, should work just the same
    //        JXPathIntrospector.registerDynamicClass(ElementHandlerImpl.class,
    //            ElementHandlerPropertyHandler.class);
    JXPathIntrospector.registerDynamicClass(NodeImpl.class, NodePropertyHandler.class);

    //        ElementHandler rootHandler =
    //        	((DocumentHandler) handlers.firstElement()).getDocumentElementHandler();
    Node root = ((DocumentHandler) handlers.firstElement()).getParseNode();
    JXPathContext jxpContext = JXPathContextFactory.newInstance().newContext(null, root);

    jxpContext.setLenient(true);

    Iterator itr = jxpContext.iterate(xpath);

    while (itr.hasNext()) {
      Object obj = itr.next();

      if (handler.getParseNode().equals(obj)) {
        return true;
      }
    }

    return false;
  }
}
origin: org.geotools/gt2-xml-xsd

  protected boolean stream(ElementHandler handler) {
    //create an xpath context from the root element
    // TODO: cache the context, should work just the same
//        JXPathIntrospector.registerDynamicClass(ElementHandlerImpl.class,
//            ElementHandlerPropertyHandler.class);
    JXPathIntrospector.registerDynamicClass( NodeImpl.class, NodePropertyHandler.class );

//        ElementHandler rootHandler = 
//            ((DocumentHandler) handlers.firstElement()).getDocumentElementHandler();
    
    Node root = ((DocumentHandler)handlers.firstElement()).getParseNode();
    JXPathContext jxpContext = 
      JXPathContextFactory.newInstance().newContext(null,root);
        
    jxpContext.setLenient(true);

    Iterator itr = jxpContext.iterate(xpath);

    for (; itr.hasNext();) {
      Object obj = itr.next();
      if (handler.getParseNode().equals(obj)) {
        return true;
      }
    }
  
    return false;
  }
  
origin: org.geotools.xsd/gt-core

  protected boolean stream(ElementHandler handler) {
    //create an xpath context from the root element
    // TODO: cache the context, should work just the same
    //        JXPathIntrospector.registerDynamicClass(ElementHandlerImpl.class,
    //            ElementHandlerPropertyHandler.class);
    JXPathIntrospector.registerDynamicClass(NodeImpl.class, NodePropertyHandler.class);

    //        ElementHandler rootHandler = 
    //        	((DocumentHandler) handlers.firstElement()).getDocumentElementHandler();
    Node root = ((DocumentHandler) handlers.firstElement()).getParseNode();
    JXPathContext jxpContext = JXPathContextFactory.newInstance().newContext(null, root);

    jxpContext.setLenient(true);

    Iterator itr = jxpContext.iterate(xpath);

    for (; itr.hasNext();) {
      Object obj = itr.next();

      if (handler.getParseNode().equals(obj)) {
        return true;
      }
    }

    return false;
  }
}
origin: org.geotools/gt2-xml-core

  protected boolean stream(ElementHandler handler) {
    //create an xpath context from the root element
    // TODO: cache the context, should work just the same
    //        JXPathIntrospector.registerDynamicClass(ElementHandlerImpl.class,
    //            ElementHandlerPropertyHandler.class);
    JXPathIntrospector.registerDynamicClass(NodeImpl.class, NodePropertyHandler.class);

    //        ElementHandler rootHandler = 
    //        	((DocumentHandler) handlers.firstElement()).getDocumentElementHandler();
    Node root = ((DocumentHandler) handlers.firstElement()).getParseNode();
    JXPathContext jxpContext = JXPathContextFactory.newInstance().newContext(null, root);

    jxpContext.setLenient(true);

    Iterator itr = jxpContext.iterate(xpath);

    for (; itr.hasNext();) {
      Object obj = itr.next();

      if (handler.getParseNode().equals(obj)) {
        return true;
      }
    }

    return false;
  }
}
origin: org.apache.cocoon/cocoon-flowscript-impl

public void initialize() throws Exception {
  if (enableDebugger) {
    if (getLogger().isDebugEnabled()) {
      getLogger().debug("Flow debugger enabled, creating");
    }
    getDebugger().doBreak();
  }
  Context context = Context.enter();
  context.setOptimizationLevel(OPTIMIZATION_LEVEL); 
  context.setCompileFunctionsWithDynamicScope(true);
  context.setGeneratingDebug(true);
  // add support for Rhino objects to JXPath
  JXPathIntrospector.registerDynamicClass(Scriptable.class,
                      ScriptablePropertyHandler.class);
  JXPathContextReferenceImpl.addNodePointerFactory(new ScriptablePointerFactory());
  try {
    scope = new Global(context);
    // Access to Cocoon internal objects
    FOM_Cocoon.init(scope);
  } catch (Exception e) {
    Context.exit();
    throw e;
  }
}
org.apache.commons.jxpathJXPathIntrospectorregisterDynamicClass

Javadoc

Automatically creates and registers a JXPathBeanInfo object for the specified class. That object returns true to JXPathBeanInfo#isDynamic().

Popular methods of JXPathIntrospector

  • getBeanInfo
    Creates and registers a JXPathBeanInfo object for the supplied class. If the class has already been
  • findDynamicBeanInfo
    Find a dynamic bean info if available for any superclasses or interfaces.
  • findInformant
    find a JXPathBeanInfo instance for the specified class. Similar to javax.beans property handler disc
  • instantiate
    Try to create an instance of a named class. First try the classloader of "sibling", then try the sys

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 12 Jupyter Notebook extensions
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