/** * Returns a deep copy of this iterator. Cloned iterators may not be * restartable. The iterator being cloned may or may not become * non-restartable as a side effect of this operation. * * @return a deep copy of this iterator. */ public DTMAxisIterator cloneIterator() { try { final DTMAxisIteratorBase clone = (DTMAxisIteratorBase) super.clone(); clone._isRestartable = false; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } }
/** * Returns a deep copy of this iterator. Cloned iterators may not be * restartable. The iterator being cloned may or may not become * non-restartable as a side effect of this operation. * * @return a deep copy of this iterator. */ public DTMAxisIterator cloneIterator() { try { final DTMAxisIteratorBase clone = (DTMAxisIteratorBase) super.clone(); clone._isRestartable = false; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } }
/** Public constructor: Wrap a DTMNodeIterator around an existing * and preconfigured DTMIterator * */ public DTMNodeIterator(DTMIterator dtmIterator) { try { dtm_iter=(DTMIterator)dtmIterator.clone(); } catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); } }
/** Public constructor: Wrap a DTMNodeIterator around an existing * and preconfigured DTMIterator * */ public DTMNodeIterator(DTMIterator dtmIterator) { try { dtm_iter=(DTMIterator)dtmIterator.clone(); } catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); } }
/** * Tell if two objects are functionally equal. * * @param obj2 object to compare this nodeset to * * @return see this.compare(...) * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { try { return compare(obj2, S_EQ); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare to this * * @return True if the two objects are equal * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } } }
/** * Tell if two objects are functionally equal. * * @param obj2 object to compare this nodeset to * * @return see this.compare(...) * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { try { return compare(obj2, S_EQ); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
/** * Receive a Locator object for document events. * * <p>By default, do nothing. Application writers may override this * method in a subclass if they wish to store the locator for use * with other document events.</p> * * @param locator A locator for all SAX document events. * @see org.xml.sax.ContentHandler#setDocumentLocator * @see org.xml.sax.Locator */ public void setDocumentLocator(Locator locator) { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } m_resultContentHandler.setDocumentLocator(locator); }
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare to this * * @return True if the two objects are equal * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } } }
/** * Get an instance of the given object in this pool * * @return An instance of the given object */ public synchronized DTMIterator getInstance() { // Check if the pool is empty. if (m_freeStack.isEmpty()) { // Create a new object if so. try { return (DTMIterator)m_orig.clone(); } catch (Exception ex) { throw new WrappedRuntimeException(ex); } } else { // Remove object from end of free pool. DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1); return result; } }
/** * Receive a Locator object for document events. * * <p>By default, do nothing. Application writers may override this * method in a subclass if they wish to store the locator for use * with other document events.</p> * * @param locator A locator for all SAX document events. * @see org.xml.sax.ContentHandler#setDocumentLocator * @see org.xml.sax.Locator */ public void setDocumentLocator(Locator locator) { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } m_resultContentHandler.setDocumentLocator(locator); }
/** * Receive a Locator object for document events. * * <p>By default, do nothing. Application writers may override this * method in a subclass if they wish to store the locator for use * with other document events.</p> * * @param locator A locator for all SAX document events. * @see org.xml.sax.ContentHandler#setDocumentLocator * @see org.xml.sax.Locator */ public void setDocumentLocator(Locator locator) { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } m_resultContentHandler.setDocumentLocator(locator); }
/** * Constructor ObjectPool * * @param className Fully qualified name of the type of objects for this pool. */ public ObjectPool(String className) { try { objectType = ObjectFactory.findProviderClass( className, ObjectFactory.findClassLoader(), true); } catch(ClassNotFoundException cnfe) { throw new WrappedRuntimeException(cnfe); } freeStack = new ArrayList(); }
/** * Constructor ObjectPool * * @param className Fully qualified name of the type of objects for this pool. */ public ObjectPool(String className) { try { objectType = ObjectFactory.findProviderClass( className, ObjectFactory.findClassLoader(), true); } catch(ClassNotFoundException cnfe) { throw new WrappedRuntimeException(cnfe); } freeStack = new ArrayList(); }
/** * Retrieve a propery bundle from a specified file * * @param file The string name of the property file. The name * should already be fully qualified as path/filename * @param target The target property bag the file will be placed into. */ public void loadPropertyFile(String file, Properties target) { try { // Use SecuritySupport class to provide priveleged access to property file SecuritySupport ss = SecuritySupport.getInstance(); InputStream is = ss.getResourceAsStream(ObjectFactory.findClassLoader(), file); // get a buffered version BufferedInputStream bis = new BufferedInputStream(is); target.load(bis); // and load up the property bag from this bis.close(); // close out after reading } catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); } } }
/** * Reset the proximity positions counts. */ public void resetProximityPositions() { int nPredicates = getPredicateCount(); if (nPredicates > 0) { if (null == m_proximityPositions) m_proximityPositions = new int[nPredicates]; for (int i = 0; i < nPredicates; i++) { try { initProximityPosition(i); } catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); } } } }
/** * Reset the proximity positions counts. */ public void resetProximityPositions() { int nPredicates = getPredicateCount(); if (nPredicates > 0) { if (null == m_proximityPositions) m_proximityPositions = new int[nPredicates]; for (int i = 0; i < nPredicates; i++) { try { initProximityPosition(i); } catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); } } } }
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare to this * * @return True if the two objects are equal * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.equals(this); try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare to this * * @return True if the two objects are equal * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.equals(this); try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare this to * * @return true if the two objects are equal * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. int t = obj2.getType(); try { if (t == XObject.CLASS_NODESET) return obj2.equals(this); else if(t == XObject.CLASS_BOOLEAN) return obj2.bool() == bool(); else return m_val == obj2.num(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }