Code example for Node

Methods: getNodeType, getOwnerDocument

0
	/** 
	 * Return the {@link CMElementDeclaration} defined for the given node. 
	 */ 
	protected static CMElementDeclaration getCMElementDeclaration(Node node) {
		CMElementDeclaration result = null;
		if (node.getNodeType() == Node.ELEMENT_NODE) {
			ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
			if (modelQuery != null) {
				result = modelQuery.getCMElementDeclaration((Element) node);
			} 
		} 
		return result;
	} 
 
	/** 
	 * Return a list of annotations that are defined for a given attribute for a specific node. 
	 */ 
	public static List<Element> getApplicationInformationElements(Node node, String attributeName) {
		try { 
			// Retrieve the declaration 
			CMElementDeclaration elementDecl = ToolAnnotationUtils.getCMElementDeclaration(node);