public void setPubSysKey(String value) { if (value != null) attr(PUB_SYS_KEY, value); }
/** * Create a new doctype element. * @param name the doctype's name * @param publicId the doctype's public ID * @param systemId the doctype's system ID * @param baseUri unused * @deprecated */ public DocumentType(String name, String pubSysKey, String publicId, String systemId, String baseUri) { attr(NAME, name); if (pubSysKey != null) { attr(PUB_SYS_KEY, pubSysKey); } attr(PUBLIC_ID, publicId); attr(SYSTEM_ID, systemId); } public void setPubSysKey(String value) {
/** * Create a new doctype element. * @param name the doctype's name * @param publicId the doctype's public ID * @param systemId the doctype's system ID * @param baseUri unused * @deprecated */ public DocumentType(String name, String publicId, String systemId, String baseUri) { attr(NAME, name); attr(PUBLIC_ID, publicId); if (has(PUBLIC_ID)) { attr(PUB_SYS_KEY, PUBLIC_KEY); } attr(SYSTEM_ID, systemId); }
private boolean has(final String attribute) { return !StringUtil.isBlank(attr(attribute)); } }
/** * Create a new doctype element. * @param name the doctype's name * @param publicId the doctype's public ID * @param systemId the doctype's system ID */ public DocumentType(String name, String publicId, String systemId) { Validate.notNull(name); Validate.notNull(publicId); Validate.notNull(systemId); attr(NAME, name); attr(PUBLIC_ID, publicId); if (has(PUBLIC_ID)) { attr(PUB_SYS_KEY, PUBLIC_KEY); } attr(SYSTEM_ID, systemId); }
@Override void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException { if (out.syntax() == Syntax.html && !has(PUBLIC_ID) && !has(SYSTEM_ID)) { // looks like a html5 doctype, go lowercase for aesthetics accum.append("<!doctype"); } else { accum.append("<!DOCTYPE"); } if (has(NAME)) accum.append(" ").append(attr(NAME)); if (has(PUB_SYS_KEY)) accum.append(" ").append(attr(PUB_SYS_KEY)); if (has(PUBLIC_ID)) accum.append(" \"").append(attr(PUBLIC_ID)).append('"'); if (has(SYSTEM_ID)) accum.append(" \"").append(attr(SYSTEM_ID)).append('"'); accum.append('>'); }