use of org.apache.xpath.Arg in project j2objc by google.
the class TransformerImpl method resetUserParameters.
/**
* Reset parameters that the user specified for the transformation.
* Called during transformer.reset() after we have cleared the
* variable stack. We need to make sure that user params are
* reset so that the transformer object can be reused.
*/
private void resetUserParameters() {
try {
if (null == m_userParams)
return;
int n = m_userParams.size();
for (int i = n - 1; i >= 0; i--) {
Arg arg = (Arg) m_userParams.elementAt(i);
QName name = arg.getQName();
// The first string might be the namespace, or it might be
// the local name, if the namespace is null.
String s1 = name.getNamespace();
String s2 = name.getLocalPart();
setParameter(s2, s1, arg.getVal().object());
}
} catch (java.util.NoSuchElementException nsee) {
// Should throw some sort of an error.
}
}
use of org.apache.xpath.Arg in project j2objc by google.
the class TransformerImpl method replaceOrPushUserParam.
/**
* NEEDSDOC Method replaceOrPushUserParam
*
* NEEDSDOC @param qname
* NEEDSDOC @param xval
*/
private void replaceOrPushUserParam(QName qname, XObject xval) {
int n = m_userParams.size();
for (int i = n - 1; i >= 0; i--) {
Arg arg = (Arg) m_userParams.elementAt(i);
if (arg.getQName().equals(qname)) {
m_userParams.setElementAt(new Arg(qname, xval, true), i);
return;
}
}
m_userParams.addElement(new Arg(qname, xval, true));
}
use of org.apache.xpath.Arg in project j2objc by google.
the class TransformerImpl method getParameter.
/**
* Get a parameter that was explicitly set with setParameter
* or setParameters.
*
* NEEDSDOC @param name
* @return A parameter that has been set with setParameter
* or setParameters,
* *not* all the xsl:params on the stylesheet (which require
* a transformation Source to be evaluated).
*/
public Object getParameter(String name) {
try {
// VariableStack varstack = getXPathContext().getVarStack();
// The first string might be the namespace, or it might be
// the local name, if the namespace is null.
QName qname = QName.getQNameFromString(name);
if (null == m_userParams)
return null;
int n = m_userParams.size();
for (int i = n - 1; i >= 0; i--) {
Arg arg = (Arg) m_userParams.elementAt(i);
if (arg.getQName().equals(qname)) {
return arg.getVal().object();
}
}
return null;
} catch (java.util.NoSuchElementException nsee) {
// Should throw some sort of an error.
return null;
}
}
use of org.apache.xpath.Arg in project robovm by robovm.
the class TransformerImpl method replaceOrPushUserParam.
/**
* NEEDSDOC Method replaceOrPushUserParam
*
*
* NEEDSDOC @param qname
* NEEDSDOC @param xval
*/
private void replaceOrPushUserParam(QName qname, XObject xval) {
int n = m_userParams.size();
for (int i = n - 1; i >= 0; i--) {
Arg arg = (Arg) m_userParams.elementAt(i);
if (arg.getQName().equals(qname)) {
m_userParams.setElementAt(new Arg(qname, xval, true), i);
return;
}
}
m_userParams.addElement(new Arg(qname, xval, true));
}
use of org.apache.xpath.Arg in project robovm by robovm.
the class TransformerImpl method getParameter.
/**
* Get a parameter that was explicitly set with setParameter
* or setParameters.
*
*
* NEEDSDOC @param name
* @return A parameter that has been set with setParameter
* or setParameters,
* *not* all the xsl:params on the stylesheet (which require
* a transformation Source to be evaluated).
*/
public Object getParameter(String name) {
try {
// VariableStack varstack = getXPathContext().getVarStack();
// The first string might be the namespace, or it might be
// the local name, if the namespace is null.
QName qname = QName.getQNameFromString(name);
if (null == m_userParams)
return null;
int n = m_userParams.size();
for (int i = n - 1; i >= 0; i--) {
Arg arg = (Arg) m_userParams.elementAt(i);
if (arg.getQName().equals(qname)) {
return arg.getVal().object();
}
}
return null;
} catch (java.util.NoSuchElementException nsee) {
// Should throw some sort of an error.
return null;
}
}