|
Java example source code file (XRTreeFragSelectWrapper.java)
The XRTreeFragSelectWrapper.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: XRTreeFragSelectWrapper.java,v 1.2.4.1 2005/09/15 02:02:35 jeffsuttor Exp $
*/
package com.sun.org.apache.xpath.internal.objects;
import com.sun.org.apache.xalan.internal.res.XSLMessages;
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.XPathContext;
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
/**
* This class makes an select statement act like an result tree fragment.
*/
public class XRTreeFragSelectWrapper extends XRTreeFrag implements Cloneable
{
static final long serialVersionUID = -6526177905590461251L;
public XRTreeFragSelectWrapper(Expression expr)
{
super(expr);
}
/**
* This function is used to fixup variables from QNames to stack frame
* indexes at stylesheet build time.
* @param vars List of QNames that correspond to variables. This list
* should be searched backwards for the first qualified name that
* corresponds to the variable reference qname. The position of the
* QName in the vector from the start of the vector will be its position
* in the stack frame (but variables above the globalsTop value will need
* to be offset to the current stack frame).
*/
public void fixupVariables(java.util.Vector vars, int globalsSize)
{
((Expression)m_obj).fixupVariables(vars, globalsSize);
}
/**
* For support of literal objects in xpaths.
*
* @param xctxt The XPath execution context.
*
* @return the result of executing the select expression
*
* @throws javax.xml.transform.TransformerException
*/
public XObject execute(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
XObject m_selected;
m_selected = ((Expression)m_obj).execute(xctxt);
m_selected.allowDetachToRelease(m_allowRelease);
if (m_selected.getType() == CLASS_STRING)
return m_selected;
else
return new XString(m_selected.str());
}
/**
* 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 XRTreeFragSelectWrapper.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.