@Override public XMLDeclaration createClone () { return new XMLDeclaration (version); }
public XMLDeclaration setEncodingEquals (String encodingEquals) { checkEquals ("encoding", encodingEquals); this.encodingEquals = encodingEquals; updateText (); return this; }
public XMLDeclaration setEncodingSpace (String encodingSpace) { checkSpace ("encoding", encodingSpace); this.encodingSpace = encodingSpace; updateText (); return this; }
public XMLDeclaration setVersionQuote (char versionQuote) { checkQuote ("version", versionQuote); this.versionQuote = versionQuote; updateText (); return this; }
if (startChar == 'v') expect (source, pos, attrName="version"); if (version != null) throw new XMLParseException ("Found a second version attribute", source, pos); expect (source, pos, attrName="encoding"); if (encoding != null) throw new XMLParseException ("Found a second encoding attribute", source, pos); expect (source, pos, attrName="standalone"); if (sawStandalone) throw new XMLParseException ("Found a second standalone attribute", source, pos); checkVersion (value); throw new XMLParseException ("Missing version attribute", source, 0); updateText ();
public XMLDeclaration setVersion (String version) { checkVersion (version); this.version = version; updateText (); return this; }
public static XMLDeclaration parseXMLDeclaration (ProcessingInstruction pi) { XMLDeclaration decl = new XMLDeclaration ("1.0"); decl.parseXMLDeclaration (pi.getValue ()); return decl; }
public String getVersion () { return xmlDeclaration == null ? null : xmlDeclaration.getVersion (); }
public String getEncoding () { return xmlDeclaration == null ? null : xmlDeclaration.getEncoding (); }
public Document copy (Node orig) { super.copy (orig); Document other = (Document)orig; this.xmlDeclaration = other.xmlDeclaration.copy (); this.docType = other.docType; if (other.namespaces != null) this.namespaces = other.namespaces.copy (); return this; }
public XMLDeclaration setStandaloneSpace (String standaloneSpace) { checkSpace ("standalone", standaloneSpace); this.standaloneSpace = standaloneSpace; updateText (); return this; }
public XMLDeclaration (String version, String encoding, boolean standalone) { super ("xml", null); checkVersion (version); if (encoding != null && encoding.trim ().length () == 0) throw new IllegalArgumentException ("encoding is blank"); this.versionSpace = " "; this.versionEquals = "="; this.versionQuote = '"'; this.version = version; this.encodingSpace = " "; this.encodingEquals = "="; this.encodingQuote = '"'; this.encoding = encoding; this.standaloneSpace = " "; this.standaloneEquals = "="; this.standaloneQuote = '"'; this.standalone = standalone; this.postSpace = ""; updateText (); }
public XMLDeclaration setVersionSpace (String versionSpace) { checkSpace ("version", versionSpace); this.versionSpace = versionSpace; updateText (); return this; }
public XMLDeclaration setStandaloneEquals (String standaloneEquals) { checkEquals ("standalone", standaloneEquals); this.standaloneEquals = standaloneEquals; updateText (); return this; }
protected XMLDeclaration createXMLDeclaration () { if (xmlDeclaration == null) { addNode (0, new XMLDeclaration ("1.0")); addNode (1, new Text ("\n")); } return xmlDeclaration; }
public XMLDeclaration setVersionEquals (String versionEquals) { checkEquals ("version", versionEquals); this.versionEquals = versionEquals; updateText (); return this; }