本文整理汇总了Java中com.sun.org.apache.xml.internal.dtm.DTMManager类的典型用法代码示例。如果您正苦于以下问题:Java DTMManager类的具体用法?Java DTMManager怎么用?Java DTMManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DTMManager类属于com.sun.org.apache.xml.internal.dtm包,在下文中一共展示了DTMManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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;
}
}
}
}
}
示例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";
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
}