当前位置: 首页>>代码示例>>Java>>正文


Java Node.NOTATION_NODE属性代码示例

本文整理汇总了Java中mf.org.w3c.dom.Node.NOTATION_NODE属性的典型用法代码示例。如果您正苦于以下问题:Java Node.NOTATION_NODE属性的具体用法?Java Node.NOTATION_NODE怎么用?Java Node.NOTATION_NODE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在mf.org.w3c.dom.Node的用法示例。


在下文中一共展示了Node.NOTATION_NODE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isLegalContainer

/**
 * Returns true IFF the given node can serve as a container
 * for a range's boundary points.
 */
private boolean isLegalContainer( Node node )
{
	if ( node==null )
		return false;

	while( node!=null )
	{
		switch( node.getNodeType() )
		{
		case Node.ENTITY_NODE:
		case Node.NOTATION_NODE:
		case Node.DOCUMENT_TYPE_NODE:
			return false;
		}
		node = node.getParentNode();
	}

	return true;
}
 
开发者ID:MaTriXy,项目名称:xerces-for-android,代码行数:23,代码来源:RangeImpl.java

示例2: isLegalContainedNode

/**
 * Returns true IFF the given node can be contained by
 * a range.
 */
private boolean isLegalContainedNode( Node node )
{
	if ( node==null )
		return false;
	switch( node.getNodeType() )
	{
	case Node.DOCUMENT_NODE:
	case Node.DOCUMENT_FRAGMENT_NODE:
	case Node.ATTRIBUTE_NODE:
	case Node.ENTITY_NODE:
	case Node.NOTATION_NODE:
		return false;
	}
	return true;
}
 
开发者ID:MaTriXy,项目名称:xerces-for-android,代码行数:19,代码来源:RangeImpl.java

示例3: notationDecl

/**
 * A notation declaration
 *
 * @param name     The name of the notation.
 * @param identifier    An object containing all location information
 *                      pertinent to this notation.
 * @param augs Additional information that may include infoset
 *                      augmentations.
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void notationDecl (String name, XMLResourceIdentifier identifier,
Augmentations augs) throws XNIException {

    // internal subset string
    String publicId = identifier.getPublicId ();
    String literalSystemId = identifier.getLiteralSystemId ();
    if (fInternalSubset != null && !fInDTDExternalSubset) {
        fInternalSubset.append ("<!NOTATION ");
        fInternalSubset.append (name);
        if (publicId != null) {
            fInternalSubset.append (" PUBLIC '");
            fInternalSubset.append (publicId);
            if (literalSystemId != null) {
                fInternalSubset.append ("' '");
                fInternalSubset.append (literalSystemId);
            }
        }
        else {
            fInternalSubset.append (" SYSTEM '");
            fInternalSubset.append (literalSystemId);
        }
        fInternalSubset.append ("'>\n");
    }

    // NOTE: We only know how to create these nodes for the Xerces
    //       DOM implementation because DOM Level 2 does not specify
    //       that functionality. -Ac

    // create full node
    if (fDocumentImpl !=null && fDocumentType != null) {
        NamedNodeMap notations = fDocumentType.getNotations ();
        if (notations.getNamedItem (name) == null) {
            NotationImpl notation = (NotationImpl)fDocumentImpl.createNotation (name);
            notation.setPublicId (publicId);
            notation.setSystemId (literalSystemId);
            notation.setBaseURI (identifier.getBaseSystemId ());
            notations.setNamedItem (notation);
        }
    }

    // create deferred node
    if (fDocumentTypeIndex != -1) {
        boolean found = false;
        int nodeIndex = fDeferredDocumentImpl.getLastChild (fDocumentTypeIndex, false);
        while (nodeIndex != -1) {
            short nodeType = fDeferredDocumentImpl.getNodeType (nodeIndex, false);
            if (nodeType == Node.NOTATION_NODE) {
                String nodeName = fDeferredDocumentImpl.getNodeName (nodeIndex, false);
                if (nodeName.equals (name)) {
                    found = true;
                    break;
                }
            }
            nodeIndex = fDeferredDocumentImpl.getPrevSibling (nodeIndex, false);
        }
        if (!found) {
            int notationIndex = fDeferredDocumentImpl.createDeferredNotation (
            name, publicId, literalSystemId, identifier.getBaseSystemId ());
            fDeferredDocumentImpl.appendChild (fDocumentTypeIndex, notationIndex);
        }
    }

}
 
开发者ID:MaTriXy,项目名称:xerces-for-android,代码行数:74,代码来源:AbstractDOMParser.java

示例4: lookupPrefix

/**
 * 
 * DOM Level 3 - Experimental:
 * Look up the prefix associated to the given namespace URI, starting from this node.
 * 
 * @param namespaceURI
 * @return the prefix for the namespace
 */
public String lookupPrefix(String namespaceURI){
    
    // REVISIT: When Namespaces 1.1 comes out this may not be true
    // Prefix can't be bound to null namespace
    if (namespaceURI == null) {
        return null;
    }

    short type = this.getNodeType();

    switch (type) {
    case Node.ELEMENT_NODE: {
            this.getNamespaceURI(); // to flip out children 
            return lookupNamespacePrefix(namespaceURI, (ElementImpl)this);
        }
    case Node.DOCUMENT_NODE:{
            return((NodeImpl)((Document)this).getDocumentElement()).lookupPrefix(namespaceURI);
        }

    case Node.ENTITY_NODE :
    case Node.NOTATION_NODE:
    case Node.DOCUMENT_FRAGMENT_NODE:
    case Node.DOCUMENT_TYPE_NODE:
        // type is unknown
        return null;
    case Node.ATTRIBUTE_NODE:{
            if (this.ownerNode.getNodeType() == Node.ELEMENT_NODE) {
                return ownerNode.lookupPrefix(namespaceURI);

            }
            return null;
        }
    default:{   
            NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
            if (ancestor != null) {
                return ancestor.lookupPrefix(namespaceURI);
            }
            return null;
        }

    }
}
 
开发者ID:MaTriXy,项目名称:xerces-for-android,代码行数:50,代码来源:NodeImpl.java

示例5: surroundContents

public void surroundContents(Node newParent)
    throws DOMException, RangeException
{
    if (newParent==null) return;
    int type = newParent.getNodeType();
    
    if (fDocument.errorChecking) {
        if (fDetach) {
            throw new DOMException(
                    DOMException.INVALID_STATE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_STATE_ERR", null));
        }
        if (type == Node.ATTRIBUTE_NODE
                || type == Node.ENTITY_NODE
                || type == Node.NOTATION_NODE
                || type == Node.DOCUMENT_TYPE_NODE
                || type == Node.DOCUMENT_NODE
                || type == Node.DOCUMENT_FRAGMENT_NODE)
        {
            throw new RangeExceptionImpl(
                    RangeException.INVALID_NODE_TYPE_ERR, 
                    DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_NODE_TYPE_ERR", null));
        }
    }
    
    Node realStart = fStartContainer;
    Node realEnd = fEndContainer;
    if (fStartContainer.getNodeType() == Node.TEXT_NODE) {
        realStart = fStartContainer.getParentNode();
    }
    if (fEndContainer.getNodeType() == Node.TEXT_NODE) {
        realEnd = fEndContainer.getParentNode();
    }
        
    if (realStart != realEnd) {
       	throw new RangeExceptionImpl(
		RangeException.BAD_BOUNDARYPOINTS_ERR, 
            DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "BAD_BOUNDARYPOINTS_ERR", null));
    }

	DocumentFragment frag = extractContents();
	insertNode(newParent);
	newParent.appendChild(frag);
	selectNode(newParent);
}
 
开发者ID:MaTriXy,项目名称:xerces-for-android,代码行数:45,代码来源:RangeImpl.java

示例6: getNodeType

/** 
 * A short integer indicating what type of node this is. The named
 * constants for this value are defined in the org.w3c.dom.Node interface.
 */
public short getNodeType() {
    return Node.NOTATION_NODE;
}
 
开发者ID:MaTriXy,项目名称:xerces-for-android,代码行数:7,代码来源:NotationImpl.java


注:本文中的mf.org.w3c.dom.Node.NOTATION_NODE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。