本文整理汇总了Java中com.sun.org.apache.xml.internal.dtm.DTMManager类的典型用法代码示例。如果您正苦于以下问题:Java DTMManager类的具体用法?Java DTMManager怎么用?Java DTMManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DTMManager类属于com.sun.org.apache.xml.internal.dtm包,在下文中一共展示了DTMManager类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: document
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
/**
* Create a DTMAxisIterator for the newdom. This is currently only
* used to create an iterator for the cached stylesheet DOM.
*
* @param newdom the cached stylesheet DOM
* @param translet the translet
* @param the main dom (should be a MultiDOM)
* @return a DTMAxisIterator from the document root
*/
private static DTMAxisIterator document(DOM newdom,
AbstractTranslet translet,
DOM dom)
throws Exception
{
DTMManager dtmManager = ((MultiDOM)dom).getDTMManager();
// Need to migrate the cached DTM to the new DTMManager
if (dtmManager != null && newdom instanceof DTM) {
((DTM)newdom).migrateTo(dtmManager);
}
translet.prepassDocument(newdom);
// Wrap the DOM object in a DOM adapter and add to multiplexer
final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom);
((MultiDOM)dom).addDOMAdapter(domAdapter);
// Create index for any key elements
translet.buildKeys(domAdapter, null, null,
newdom.getDocument());
// Return a singleton iterator containing the root node
return new SingletonIterator(newdom.getDocument(), true);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:LoadDocument.java
示例2: setStartNode
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
public DTMAxisIterator setStartNode(final int node) {
if (node == DTM.NULL) {
return this;
}
int dom = node >>> DTMManager.IDENT_DTM_NODE_BITS;
// Get a new source first time and when mask changes
if (_source == null || _dtmId != dom) {
if (_type == NO_TYPE) {
_source = _adapters[dom].getAxisIterator(_axis);
} else if (_axis == Axis.CHILD) {
_source = _adapters[dom].getTypedChildren(_type);
} else {
_source = _adapters[dom].getTypedAxisIterator(_axis, _type);
}
}
_dtmId = dom;
_source.setStartNode(node);
return this;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:MultiDOM.java
示例3: removeDOMAdapter
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
public void removeDOMAdapter(DOMAdapter adapter) {
_documents.remove(adapter.getDocumentURI(0));
DOM dom = adapter.getDOMImpl();
if (dom instanceof DTMDefaultBase) {
SuballocatedIntVector ids = ((DTMDefaultBase) dom).getDTMIDs();
int idsSize = ids.size();
for (int i = 0; i < idsSize; i++) {
_adapters[ids.elementAt(i) >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
}
} else {
int id = dom.getDocument() >>> DTMManager.IDENT_DTM_NODE_BITS;
if ((id > 0) && (id < _adapters.length) && isMatchingAdapterEntry(_adapters[id], adapter)) {
_adapters[id] = null;
} else {
boolean found = false;
for (int i = 0; i < _adapters.length; i++) {
if (isMatchingAdapterEntry(_adapters[id], adapter)) {
_adapters[i] = null;
found = true;
break;
}
}
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:MultiDOM.java
示例4: addNewDTMID
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
/**
* Get a new DTM ID beginning at the specified node index.
* @param nodeIndex The node identity at which the new DTM ID will begin
* addressing.
*/
protected void addNewDTMID(int nodeIndex) {
try
{
if(m_mgr==null)
throw new ClassCastException();
// Handle as Extended Addressing
DTMManagerDefault mgrD=(DTMManagerDefault)m_mgr;
int id=mgrD.getFirstFreeDTMID();
mgrD.addDTM(this,id,nodeIndex);
m_dtmIdent.addElement(id<<DTMManager.IDENT_DTM_NODE_BITS);
}
catch(ClassCastException e)
{
// %REVIEW% Wrong error message, but I've been told we're trying
// not to add messages right not for I18N reasons.
// %REVIEW% Should this be a Fatal Error?
error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available";
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:SAX2DTM.java
示例5: migrateTo
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
/**
* Migrate a DTM built with an old DTMManager to a new DTMManager.
* After the migration, the new DTMManager will treat the DTM as
* one that is built by itself.
* This is used to support DTM sharing between multiple transformations.
* @param manager the DTMManager
*/
public void migrateTo(DTMManager manager) {
super.migrateTo(manager);
// We have to reset the information in m_dtmIdent and
// register the DTM with the new manager.
int numDTMs = m_dtmIdent.size();
int dtmId = m_mgrDefault.getFirstFreeDTMID();
int nodeIndex = 0;
for (int i = 0; i < numDTMs; i++)
{
m_dtmIdent.setElementAt(dtmId << DTMManager.IDENT_DTM_NODE_BITS, i);
m_mgrDefault.addDTM(this, dtmId, nodeIndex);
dtmId++;
nodeIndex += (1 << DTMManager.IDENT_DTM_NODE_BITS);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:SAX2DTM.java
示例6: getExpandedTypeID
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
public int getExpandedTypeID(final int node) {
if (node != DTM.NULL) {
return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].getExpandedTypeID(node);
}
else {
return DTM.NULL;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:MultiDOM.java
示例7: copy
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
public void copy(final int node, SerializationHandler handler)
throws TransletException
{
if (node != DTM.NULL) {
_adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].copy(node, handler);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:MultiDOM.java
示例8: shallowCopy
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
public String shallowCopy(final int node, SerializationHandler handler)
throws TransletException
{
if (node == DTM.NULL) {
return "";
}
return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].shallowCopy(node, handler);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:MultiDOM.java
示例9: characters
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
public void characters(final int textNode, SerializationHandler handler)
throws TransletException
{
if (textNode != DTM.NULL) {
_adapters[textNode >>> DTMManager.IDENT_DTM_NODE_BITS].characters(textNode, handler);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:MultiDOM.java
示例10: getDTMId
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
public int getDTMId(int nodeHandle)
{
if (nodeHandle == DTM.NULL)
return 0;
int id = nodeHandle >>> DTMManager.IDENT_DTM_NODE_BITS;
while (id >= 2 && _adapters[id] == _adapters[id-1]) {
id--;
}
return id;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:MultiDOM.java
示例11: SAX2RTFDTM
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
public SAX2RTFDTM(DTMManager mgr, Source source, int dtmIdentity,
DTMWSFilter whiteSpaceFilter,
XMLStringFactory xstringfactory,
boolean doIndexing)
{
super(mgr, source, dtmIdentity, whiteSpaceFilter,
xstringfactory, doIndexing);
// NEVER track source locators for RTFs; they aren't meaningful. I think.
// (If we did track them, we'd need to tail-prune these too.)
//com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl.m_source_location;
m_useSourceLocationProperty=false;
m_sourceSystemId = (m_useSourceLocationProperty) ? new StringVector()
: null;
m_sourceLine = (m_useSourceLocationProperty) ? new IntVector() : null;
m_sourceColumn = (m_useSourceLocationProperty) ? new IntVector() : null;
// Record initial sizes of fields that are pushed and restored
// for RTF tail-pruning. More entries can be popped than pushed, so
// we need this to mark the primordial state of the DTM.
m_emptyNodeCount = m_size;
m_emptyNSDeclSetCount = (m_namespaceDeclSets == null)
? 0 : m_namespaceDeclSets.size();
m_emptyNSDeclSetElemsCount = (m_namespaceDeclSetElements == null)
? 0 : m_namespaceDeclSetElements.size();
m_emptyDataCount = m_data.size();
m_emptyCharsCount = m_chars.size();
m_emptyDataQNCount = m_dataOrQName.size();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:SAX2RTFDTM.java
示例12: XNodeSetForDOM
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
public XNodeSetForDOM(Node node, DTMManager dtmMgr)
{
m_dtmMgr = dtmMgr;
m_origObj = node;
int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
setObject(new NodeSetDTM(dtmMgr));
((NodeSetDTM) m_obj).addNode(dtmHandle);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:XNodeSetForDOM.java
示例13: XNodeSet
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
/**
* Construct a XNodeSet object for one node.
*
* @param n Node to add to the new XNodeSet object
*/
public XNodeSet(int n, DTMManager dtmMgr)
{
super(new NodeSetDTM(dtmMgr));
m_dtmMgr = dtmMgr;
if (DTM.NULL != n)
{
((NodeSetDTM) m_obj).addNode(n);
m_last = 1;
}
else
m_last = 0;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:XNodeSet.java
示例14: NodeSequence
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
/**
* Construct an empty XNodeSet object. This is used to create a mutable
* nodeset to which random nodes may be added.
*/
private NodeSequence(DTMManager dtmMgr)
{
super(new NodeVector());
m_last = 0;
m_dtmMgr = dtmMgr;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:NodeSequence.java
示例15: getDTM
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
/**
* @see DTMIterator#getDTM(int)
*/
public DTM getDTM(int nodeHandle)
{
DTMManager mgr = getDTMManager();
if(null != mgr)
return getDTMManager().getDTM(nodeHandle);
else
{
assertion(false, "Can not get a DTM Unless a DTMManager has been set!");
return null;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:NodeSequence.java
示例16: NodeSetDTM
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
/**
* Create a NodeSetDTM which contains the given Node.
*
* @param node Single node to be added to the new set.
*/
public NodeSetDTM(int node, DTMManager dtmManager)
{
super();
m_manager = dtmManager;
addNode(node);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:NodeSetDTM.java
示例17: init
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
private void init(boolean useServicesMechanism) {
m_prefixResolvers.push(null);
m_currentNodes.push(DTM.NULL);
m_currentExpressionNodes.push(DTM.NULL);
m_saxLocations.push(null);
m_useServicesMechanism = useServicesMechanism;
m_dtmManager = DTMManager.newInstance(
com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory()
);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:XPathContext.java
示例18: reset
import com.sun.org.apache.xml.internal.dtm.DTMManager; //导入依赖的package包/类
/**
* Reset for new run.
*/
public void reset()
{
releaseDTMXRTreeFrags();
// These couldn't be disposed of earlier (see comments in release()); zap them now.
if(m_rtfdtm_stack!=null)
for (java.util.Enumeration e = m_rtfdtm_stack.elements() ; e.hasMoreElements() ;)
m_dtmManager.release((DTM)e.nextElement(), true);
m_rtfdtm_stack=null; // drop our references too
m_which_rtfdtm=-1;
if(m_global_rtfdtm!=null)
m_dtmManager.release(m_global_rtfdtm,true);
m_global_rtfdtm=null;
m_dtmManager = DTMManager.newInstance(
com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory()
);
m_saxLocations.removeAllElements();
m_axesIteratorStack.removeAllElements();
m_contextNodeLists.removeAllElements();
m_currentExpressionNodes.removeAllElements();
m_currentNodes.removeAllElements();
m_iteratorRoots.RemoveAllNoClear();
m_predicatePos.removeAllElements();
m_predicateRoots.RemoveAllNoClear();
m_prefixResolvers.removeAllElements();
m_prefixResolvers.push(null);
m_currentNodes.push(DTM.NULL);
m_currentExpressionNodes.push(DTM.NULL);
m_saxLocations.push(null);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:XPathContext.java
注:本文中的com.sun.org.apache.xml.internal.dtm.DTMManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论