/** */ public static boolean isWholeTagOmissible(CMElementDeclaration decl) { if (!(decl.supports(HTMLCMProperties.OMIT_TYPE))) return false; String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE); return omitType.equals(HTMLCMProperties.Values.OMIT_BOTH); }
private static CMNamedNodeMap getProhibitedAncestors(CMElementDeclaration dec) { if (!dec.supports(HTMLCMProperties.PROHIBITED_ANCESTORS)) return null; return (CMNamedNodeMap) dec.getProperty(HTMLCMProperties.PROHIBITED_ANCESTORS); }
/** * Test whether this is the JSP core tag. * * @param decl * @return true if decl is a jsp element declaration */ public static boolean isJSP(CMElementDeclaration decl) { if (!decl.supports(HTMLCMProperties.IS_JSP)) { return false; } Boolean b = (Boolean) decl.getProperty(HTMLCMProperties.IS_JSP); return b.booleanValue(); }
/** */ public static boolean isCaseSensitive(CMElementDeclaration decl) { if (decl == null || (!decl.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))) return false; return !((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue(); }
/** */ public static boolean isSSI(CMElementDeclaration edec) { if (edec == null) return false; if (!edec.supports(HTMLCMProperties.IS_SSI)) return false; return ((Boolean) edec.getProperty(HTMLCMProperties.IS_SSI)).booleanValue(); }
/** */ protected boolean canInsertBreakAfter(CMElementDeclaration decl) { if (decl == null) return false; if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)) return false; String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT); if (hint == null) return false; return (hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END) || hint.equals(HTMLCMProperties.Values.BREAK_AFTER_START)); }
/** */ protected boolean canInsertBreakBefore(CMElementDeclaration decl) { if (decl == null) return false; if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)) return false; String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT); if (hint == null) return false; return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END); }
/** */ public static boolean isEndTagOmissible(CMElementDeclaration decl) { if (!(decl.supports(HTMLCMProperties.OMIT_TYPE))) return false; String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE); return !omitType.equals(HTMLCMProperties.Values.OMIT_NONE); }
/** * @param decl * @return true if decl is a JSP tag */ public static boolean isJSP(CMElementDeclaration decl) { if (!decl.supports(HTMLCMProperties.IS_JSP)) { return false; } return ((Boolean) decl.getProperty(HTMLCMProperties.IS_JSP)) .booleanValue(); } }
/** */ public static boolean isJSP(CMElementDeclaration decl) { if (!decl.supports(HTMLCMProperties.IS_JSP)) return false; return ((Boolean) decl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue(); }
/** */ public static boolean isXHTML(CMElementDeclaration decl) { if (!decl.supports(HTMLCMProperties.IS_XHTML)) return false; return ((Boolean) decl.getProperty(HTMLCMProperties.IS_XHTML)).booleanValue(); }
private static Collection gatherInclusions(Collection ancestors) { Vector inclusions = new Vector(); Iterator iter = ancestors.iterator(); while (iter.hasNext()) { CMElementDeclaration decl = (CMElementDeclaration) iter.next(); if (decl.supports(HTMLCMProperties.INCLUSION)) { CMContent inclusion = (CMContent) decl.getProperty(HTMLCMProperties.INCLUSION); if (inclusion != null) inclusions.add(inclusion); } } return inclusions; }
private boolean shouldTerminateAt(CMElementDeclaration parent, CMElementDeclaration child) { if (!parent.supports(HTMLCMProperties.TERMINATORS)) return false; java.util.Iterator i = (java.util.Iterator) parent.getProperty(HTMLCMProperties.TERMINATORS); if (i == null) return false; String nextName = child.getElementName(); while (i.hasNext()) { // NOTE: CMElementDeclaration of child is not always HTMLCMElementDeclaration. // It might be one of based on DTD (for XHTML element). So, comparison must // be performed ignoring case. // -- 3/20/2002 String terminator = (String) i.next(); if (terminator == null) continue; if (nextName.equalsIgnoreCase(terminator)) return true; } return false; }
/** */ protected boolean canFormatChild(Node node) { while (node != null) { if (node.getNodeType() != Node.ELEMENT_NODE) return true; CMElementDeclaration decl = getElementDeclaration((Element) node); if (decl != null) { if (decl.getContentType() == CMElementDeclaration.CDATA) return false; if (decl.supports(HTMLCMProperties.SHOULD_KEEP_SPACE)) { boolean shouldKeepSpace = ((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_KEEP_SPACE)).booleanValue(); if (shouldKeepSpace) return false; } } node = node.getParentNode(); } return false; }
/** */ private boolean canRemoveHeadingSpaces(IDOMNode node) { if (node == null) return false; if (node.getPreviousSibling() != null) return false; Node parent = node.getParentNode(); if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE) return false; CMElementDeclaration decl = getElementDeclaration((Element) parent); if (decl == null || (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT))) return false; String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT); return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END); }
/** */ private boolean canRemoveTailingSpaces(IDOMNode node) { if (node == null) return false; if (node.getNextSibling() != null) return false; Node parent = node.getParentNode(); if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE) return false; CMElementDeclaration decl = getElementDeclaration((Element) parent); if (decl == null || (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT))) return false; String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT); return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END); }
if (!ed.supports(HTMLCMProperties.IS_XHTML)) return originalCandidates;
if (decl != null && decl.supports(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE)) { boolean shouldIndent = ((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE)).booleanValue(); if (shouldIndent)
if (!CMUtil.isHTML(dec)) return; // no need to validate if (!dec.supports(HTMLCMProperties.PROHIBITED_ANCESTORS)) return; // cannot validate. CMNamedNodeMap prohibited = (CMNamedNodeMap) dec.getProperty(HTMLCMProperties.PROHIBITED_ANCESTORS);