/** */ public static CMElementDeclaration getElementDeclaration(Element element) { if (element == null) return null; return ((ElementImpl) element).getDeclaration(); } }
/** */ protected CMAttributeDeclaration getDeclaration() { ElementImpl element = (ElementImpl) getOwnerElement(); if (element == null) return null; CMElementDeclaration elementDecl = element.getDeclaration(); if (elementDecl == null) return null; CMNamedNodeMap attributes = elementDecl.getAttributes(); if (attributes == null) return null; return (CMAttributeDeclaration) attributes.getNamedItem(getName()); }
/** */ public boolean preferEmptyTag() { if (hasChildNodes()) return false; if (isJSPTag()) return false; if (isCommentTag()) return false; if (!isXMLTag()) return false; CMElementDeclaration decl = getDeclaration(); if (decl == null) return false; return (decl.getContentType() == CMElementDeclaration.EMPTY); }
/** * isContainer method * * @return boolean */ public boolean isContainer() { if (isCommentTag()) { CommentElementAdapter adapter = (CommentElementAdapter) getAdapterFor(CommentElementAdapter.class); if (adapter != null) { return (adapter.isContainer()); } return (getDeclaration() == null); } if (isJSPTag()) { // exclude JSP directive return (matchTagName(JSPTag.JSP_SCRIPTLET) || matchTagName(JSPTag.JSP_DECLARATION) || matchTagName(JSPTag.JSP_EXPRESSION)); } if (!isXMLTag()) { // non-XML tag CMElementDeclaration decl = getDeclaration(); if (decl == null) return false; // undefined tag return (decl.getContentType() != CMElementDeclaration.EMPTY); } return true; }