本文整理汇总了Java中org.apache.xml.dtm.DTM.ENTITY_NODE属性的典型用法代码示例。如果您正苦于以下问题:Java DTM.ENTITY_NODE属性的具体用法?Java DTM.ENTITY_NODE怎么用?Java DTM.ENTITY_NODE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.xml.dtm.DTM
的用法示例。
在下文中一共展示了DTM.ENTITY_NODE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHead
/**
* Get the head of the most likely list of associations to check, based on
* the name and type of the targetNode argument.
*
* @param xctxt The XPath runtime context.
* @param targetNode The target node that will be checked for a match.
* @param dtm The dtm owner for the target node.
*
* @return The head of a linked list that contains all possible match pattern to
* template associations.
*/
public TemplateSubPatternAssociation getHead(XPathContext xctxt,
int targetNode, DTM dtm)
{
short targetNodeType = dtm.getNodeType(targetNode);
TemplateSubPatternAssociation head;
switch (targetNodeType)
{
case DTM.ELEMENT_NODE :
case DTM.ATTRIBUTE_NODE :
head = (TemplateSubPatternAssociation) m_patternTable.get(
dtm.getLocalName(targetNode));
break;
case DTM.TEXT_NODE :
case DTM.CDATA_SECTION_NODE :
head = m_textPatterns;
break;
case DTM.ENTITY_REFERENCE_NODE :
case DTM.ENTITY_NODE :
head = (TemplateSubPatternAssociation) m_patternTable.get(
dtm.getNodeName(targetNode)); // %REVIEW% I think this is right
break;
case DTM.PROCESSING_INSTRUCTION_NODE :
head = (TemplateSubPatternAssociation) m_patternTable.get(
dtm.getLocalName(targetNode));
break;
case DTM.COMMENT_NODE :
head = m_commentPatterns;
break;
case DTM.DOCUMENT_NODE :
case DTM.DOCUMENT_FRAGMENT_NODE :
head = m_docPatterns;
break;
case DTM.NOTATION_NODE :
default :
head = (TemplateSubPatternAssociation) m_patternTable.get(
dtm.getNodeName(targetNode)); // %REVIEW% I think this is right
}
return (null == head) ? m_wildCardPatterns : head;
}
示例2: getNodeTypeTest
/**
* Tell what node type to test, if not DTMFilter.SHOW_ALL.
*
* @param whatToShow Bit set defined mainly by
* {@link org.apache.xml.dtm.DTMFilter}.
* @return the node type for the whatToShow. Since whatToShow can specify
* multiple types, it will return the first bit tested that is on,
* so the caller of this function should take care that this is
* the function they really want to call. If none of the known bits
* are set, this function will return zero.
*/
public static int getNodeTypeTest(int whatToShow)
{
// %REVIEW% Is there a better way?
if (0 != (whatToShow & DTMFilter.SHOW_ELEMENT))
return DTM.ELEMENT_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_ATTRIBUTE))
return DTM.ATTRIBUTE_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_TEXT))
return DTM.TEXT_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT))
return DTM.DOCUMENT_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_FRAGMENT))
return DTM.DOCUMENT_FRAGMENT_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_NAMESPACE))
return DTM.NAMESPACE_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_COMMENT))
return DTM.COMMENT_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_PROCESSING_INSTRUCTION))
return DTM.PROCESSING_INSTRUCTION_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_TYPE))
return DTM.DOCUMENT_TYPE_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_ENTITY))
return DTM.ENTITY_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_ENTITY_REFERENCE))
return DTM.ENTITY_REFERENCE_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_NOTATION))
return DTM.NOTATION_NODE;
if (0 != (whatToShow & DTMFilter.SHOW_CDATA_SECTION))
return DTM.CDATA_SECTION_NODE;
return 0;
}