public XmlDeclaration(final Document ownerDocument, final CharSequence version, final CharSequence encoding, final CharSequence standalone) { super(ownerDocument, NodeType.XML_DECLARATION, "xml"); this.version = Util.toString(version); this.encoding = Util.toString(encoding); this.standalone = Util.toString(standalone); }
@Override public void doctype(final Doctype doctype) { if (!enabled) { return; } DocumentType documentType = new DocumentType(rootNode, Util.toString(doctype.getName()), Util.toString(doctype.getPublicIdentifier()), Util.toString(doctype.getSystemIdentifier()) ); parentNode.addChild(documentType); }
public Element(final Document ownerNode, final Tag tag, final boolean voidElement, final boolean selfClosed) { super(ownerNode, NodeType.ELEMENT, Util.toString(tag.getName())); this.voidElement = voidElement; this.selfClosed = selfClosed; this.rawTag = tag.isRawTag(); int attrCount = tag.getAttributeCount(); for (int i = 0; i < attrCount; i++) { String key = Util.toString(tag.getAttributeName(i)); String value = Util.toString(tag.getAttributeValue(i)); setAttribute(key, value); } }
@Override public void tag(final Tag tag) { if (!insideConditionalComment) { if (tag.nameEquals(T_LINK)) { CharSequence type = tag.getAttributeValue("type"); if (type != null && CharSequenceUtil.equalsIgnoreCase(type, "text/css")) { String media = Util.toString(tag.getAttributeValue("media")); if (media == null || media.contains("screen")) { String href = Util.toString(tag.getAttributeValue("href")); if (cssBundleAction.acceptLink(href)) { String link = cssBundleAction.processLink(href); if (link != null) { tag.setAttribute("href", link); super.tag(tag); } return; } } } } } super.tag(tag); }
@Override public void script(final Tag tag, final CharSequence body) { if (!insideConditionalComment) { String src = Util.toString(tag.getAttributeValue("src")); if (src == null) { super.script(tag, body); return; } if (jsBundleAction.acceptLink(src)) { String link = jsBundleAction.processLink(src); if (link != null) { tag.setAttributeValue("src", link); super.script(tag, body); } return; } } super.script(tag, body); }
public XmlDeclaration(final Document ownerDocument, final CharSequence version, final CharSequence encoding, final CharSequence standalone) { super(ownerDocument, NodeType.XML_DECLARATION, "xml"); this.version = Util.toString(version); this.encoding = Util.toString(encoding); this.standalone = Util.toString(standalone); }
@Override public void doctype(final Doctype doctype) { if (!enabled) { return; } DocumentType documentType = new DocumentType(rootNode, Util.toString(doctype.getName()), Util.toString(doctype.getPublicIdentifier()), Util.toString(doctype.getSystemIdentifier()) ); parentNode.addChild(documentType); }
public Element(Document ownerNode, Tag tag, boolean voidElement, boolean selfClosed) { super(ownerNode, NodeType.ELEMENT, Util.toString(tag.getName())); this.voidElement = voidElement; this.selfClosed = selfClosed; this.rawTag = tag.isRawTag(); int attrCount = tag.getAttributeCount(); for (int i = 0; i < attrCount; i++) { String key = Util.toString(tag.getAttributeName(i)); String value = Util.toString(tag.getAttributeValue(i)); setAttribute(key, value); } }
public Element(final Document ownerNode, final Tag tag, final boolean voidElement, final boolean selfClosed) { super(ownerNode, NodeType.ELEMENT, Util.toString(tag.getName())); this.voidElement = voidElement; this.selfClosed = selfClosed; this.rawTag = tag.isRawTag(); int attrCount = tag.getAttributeCount(); for (int i = 0; i < attrCount; i++) { String key = Util.toString(tag.getAttributeName(i)); String value = Util.toString(tag.getAttributeValue(i)); setAttribute(key, value); } }
@Override public void tag(final Tag tag) { if (!insideConditionalComment) { if (tag.nameEquals(T_LINK)) { CharSequence type = tag.getAttributeValue("type"); if (type != null && CharSequenceUtil.equalsIgnoreCase(type, "text/css")) { String media = Util.toString(tag.getAttributeValue("media")); if (media == null || media.contains("screen")) { String href = Util.toString(tag.getAttributeValue("href")); if (cssBundleAction.acceptLink(href)) { String link = cssBundleAction.processLink(href); if (link != null) { tag.setAttribute("href", link); super.tag(tag); } return; } } } } } super.tag(tag); }
@Override public void script(final Tag tag, final CharSequence body) { if (!insideConditionalComment) { String src = Util.toString(tag.getAttributeValue("src")); if (src == null) { super.script(tag, body); return; } if (jsBundleAction.acceptLink(src)) { String link = jsBundleAction.processLink(src); if (link != null) { tag.setAttributeValue("src", link); super.script(tag, body); } return; } } super.script(tag, body); }