本文整理汇总了Java中com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM.getMapping方法的典型用法代码示例。如果您正苦于以下问题:Java DOMEnhancedForDTM.getMapping方法的具体用法?Java DOMEnhancedForDTM.getMapping怎么用?Java DOMEnhancedForDTM.getMapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM
的用法示例。
在下文中一共展示了DOMEnhancedForDTM.getMapping方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getShouldStripSpace
import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM; //导入方法依赖的package包/类
/**
* Test whether whitespace-only text nodes are visible in the logical
* view of <code>DTM</code>. Normally, this function
* will be called by the implementation of <code>DTM</code>;
* it is not normally called directly from
* user code.
*
* @param node int handle of the node.
* @param dtm the DTM that owns this node
* @return one of <code>NOTSTRIP</code>, <code>STRIP</code> or
* <code>INHERIT</code>.
*/
public short getShouldStripSpace(int node, DTM dtm) {
if (m_filter != null && dtm instanceof DOM) {
DOM dom = (DOM)dtm;
int type = 0;
if (dtm instanceof DOMEnhancedForDTM) {
DOMEnhancedForDTM mappableDOM = (DOMEnhancedForDTM)dtm;
short[] mapping;
if (dtm == m_currentDTM) {
mapping = m_currentMapping;
}
else {
mapping = (short[])m_mappings.get(dtm);
if (mapping == null) {
mapping = mappableDOM.getMapping(
m_translet.getNamesArray(),
m_translet.getUrisArray(),
m_translet.getTypesArray());
m_mappings.put(dtm, mapping);
m_currentDTM = dtm;
m_currentMapping = mapping;
}
}
int expType = mappableDOM.getExpandedTypeID(node);
// %OPT% The mapping array does not have information about all the
// exptypes. However it does contain enough information about all names
// in the translet's namesArray. If the expType does not fall into the
// range of the mapping array, it means that the expType is not for one
// of the recognized names. In this case we can just set the type to -1.
if (expType >= 0 && expType < mapping.length)
type = mapping[expType];
else
type = -1;
}
else {
return INHERIT;
}
if (m_filter.stripSpace(dom, node, type)) {
return STRIP;
} else {
return NOTSTRIP;
}
} else {
return NOTSTRIP;
}
}
示例2: getShouldStripSpace
import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM; //导入方法依赖的package包/类
/**
* Test whether whitespace-only text nodes are visible in the logical
* view of <code>DTM</code>. Normally, this function
* will be called by the implementation of <code>DTM</code>;
* it is not normally called directly from
* user code.
*
* @param node int handle of the node.
* @param dtm the DTM that owns this node
* @return one of <code>NOTSTRIP</code>, <code>STRIP</code> or
* <code>INHERIT</code>.
*/
public short getShouldStripSpace(int node, DTM dtm) {
if (m_filter != null && dtm instanceof DOM) {
DOM dom = (DOM)dtm;
int type = 0;
if (dtm instanceof DOMEnhancedForDTM) {
DOMEnhancedForDTM mappableDOM = (DOMEnhancedForDTM)dtm;
short[] mapping;
if (dtm == m_currentDTM) {
mapping = m_currentMapping;
}
else {
mapping = m_mappings.get(dtm);
if (mapping == null) {
mapping = mappableDOM.getMapping(
m_translet.getNamesArray(),
m_translet.getUrisArray(),
m_translet.getTypesArray());
m_mappings.put(dtm, mapping);
m_currentDTM = dtm;
m_currentMapping = mapping;
}
}
int expType = mappableDOM.getExpandedTypeID(node);
// %OPT% The mapping array does not have information about all the
// exptypes. However it does contain enough information about all names
// in the translet's namesArray. If the expType does not fall into the
// range of the mapping array, it means that the expType is not for one
// of the recognized names. In this case we can just set the type to -1.
if (expType >= 0 && expType < mapping.length)
type = mapping[expType];
else
type = -1;
}
else {
return INHERIT;
}
if (m_filter.stripSpace(dom, node, type)) {
return STRIP;
} else {
return NOTSTRIP;
}
} else {
return NOTSTRIP;
}
}