Class XMLDeclaration

    • Field Detail

      • ATTRIBUTE_NAME_VERSION

        public static final java.lang.String ATTRIBUTE_NAME_VERSION
        See Also:
        Constant Field Values
      • ATTRIBUTE_NAME_ENCODING

        public static final java.lang.String ATTRIBUTE_NAME_ENCODING
        See Also:
        Constant Field Values
      • ATTRIBUTE_NAME_STANDALONE

        public static final java.lang.String ATTRIBUTE_NAME_STANDALONE
        See Also:
        Constant Field Values
      • keyword

        private final java.lang.String keyword
      • version

        private final java.lang.String version
      • encoding

        private final java.lang.String encoding
      • standalone

        private final java.lang.String standalone
      • xmlDeclaration

        private final java.lang.String xmlDeclaration
    • Constructor Detail

      • XMLDeclaration

        XMLDeclaration​(java.lang.String encoding)
      • XMLDeclaration

        XMLDeclaration​(java.lang.String keyword,
                       java.lang.String version,
                       java.lang.String encoding,
                       java.lang.String standalone)
      • XMLDeclaration

        XMLDeclaration​(java.lang.String xmlDeclaration,
                       java.lang.String keyword,
                       java.lang.String version,
                       java.lang.String encoding,
                       java.lang.String standalone,
                       java.lang.String templateName,
                       int line,
                       int col)
    • Method Detail

      • getKeyword

        public java.lang.String getKeyword()
        Description copied from interface: IXMLDeclaration

        Returns the keyword of the XML Declaration in its original case (usually xml).

        Specified by:
        getKeyword in interface IXMLDeclaration
        Returns:
        the XML Declaration keyword.
      • getVersion

        public java.lang.String getVersion()
        Description copied from interface: IXMLDeclaration

        Returns the XML version specified at the XML Declaration (if specified).

        Specified by:
        getVersion in interface IXMLDeclaration
        Returns:
        the XML version (might be null).
      • getEncoding

        public java.lang.String getEncoding()
        Description copied from interface: IXMLDeclaration

        Returns the value of the encoding attribute specified at the XML Declaration (if specified).

        Specified by:
        getEncoding in interface IXMLDeclaration
        Returns:
        the encoding value (might be null).
      • getStandalone

        public java.lang.String getStandalone()
        Description copied from interface: IXMLDeclaration

        Returns the value of the standalone attribute specified at the XML Declaration (if specified).

        Specified by:
        getStandalone in interface IXMLDeclaration
        Returns:
        the standalone value (might be null).
      • getXmlDeclaration

        public java.lang.String getXmlDeclaration()
        Description copied from interface: IXMLDeclaration

        Returns the complete XML Declaration as a String.

        Specified by:
        getXmlDeclaration in interface IXMLDeclaration
        Returns:
        the complete XML Declaration.
      • computeXmlDeclaration

        private java.lang.String computeXmlDeclaration()
      • write

        public void write​(java.io.Writer writer)
                   throws java.io.IOException
        Description copied from interface: ITemplateEvent

        Writes this event to the specified Writer.

        Template output performed at OutputTemplateHandler is done by calling these methods at each of the events resulting from template processing.

        Specified by:
        write in interface ITemplateEvent
        Parameters:
        writer - the writer this event should be written to.
        Throws:
        java.io.IOException - if an input/output exception occurs.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object