|
Java example source code file (XRTreeFrag.java)
The XRTreeFrag.java Java example source code
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XRTreeFrag.java,v 1.2.4.1 2005/09/14 20:44:48 jeffsuttor Exp $
*/
package com.sun.org.apache.xpath.internal.objects;
import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMIterator;
import com.sun.org.apache.xml.internal.utils.XMLString;
import com.sun.org.apache.xpath.internal.Expression;
import com.sun.org.apache.xpath.internal.ExpressionNode;
import com.sun.org.apache.xpath.internal.XPathContext;
import com.sun.org.apache.xpath.internal.axes.RTFIterator;
import org.w3c.dom.NodeList;
/**
* This class represents an XPath result tree fragment object, and is capable of
* converting the RTF to other types, such as a string.
* @xsl.usage general
*/
public class XRTreeFrag extends XObject implements Cloneable
{
static final long serialVersionUID = -3201553822254911567L;
private DTMXRTreeFrag m_DTMXRTreeFrag;
private int m_dtmRoot = DTM.NULL;
protected boolean m_allowRelease = false;
/**
* Create an XRTreeFrag Object.
*
*/
public XRTreeFrag(int root, XPathContext xctxt, ExpressionNode parent)
{
super(null);
exprSetParent(parent);
initDTM(root, xctxt);
}
/**
* Create an XRTreeFrag Object.
*
*/
public XRTreeFrag(int root, XPathContext xctxt)
{
super(null);
initDTM(root, xctxt);
}
private final void initDTM(int root, XPathContext xctxt){
m_dtmRoot = root;
final DTM dtm = xctxt.getDTM(root);
if(dtm != null){
m_DTMXRTreeFrag = xctxt.getDTMXRTreeFrag(xctxt.getDTMIdentity(dtm));
}
}
/**
* Return a java object that's closest to the representation
* that should be handed to an extension.
*
* @return The object that this class wraps
*/
public Object object()
{
if (m_DTMXRTreeFrag.getXPathContext() != null)
return new com.sun.org.apache.xml.internal.dtm.ref.DTMNodeIterator((DTMIterator)(new com.sun.org.apache.xpath.internal.NodeSetDTM(m_dtmRoot, m_DTMXRTreeFrag.getXPathContext().getDTMManager())));
else
return super.object();
}
/**
* Create an XRTreeFrag Object.
*
*/
public XRTreeFrag(Expression expr)
{
super(expr);
}
/**
* Specify if it's OK for detach to release the iterator for reuse.
*
* @param allowRelease true if it is OK for detach to release this iterator
* for pooling.
*/
public void allowDetachToRelease(boolean allowRelease)
{
m_allowRelease = allowRelease;
}
/**
* Detaches the <code>DTMIterator from the set which it iterated
* over, releasing any computational resources and placing the iterator
* in the INVALID state. After <code>detach has been invoked,
* calls to <code>nextNode or
Other Java examples (source code examples)Here is a short list of links related to this Java XRTreeFrag.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.