Class OutputBuffer

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void assertNoMixedRegions​(RegionType regionType)  
      protected java.lang.String calculateIndentationToMatch​(java.lang.String previousLine)  
      void chop​(int chars)
      Removes the specified number of characters from the end of the buffer.
      void formatWith​(Formatter formatter)
      Reformats the contents of the buffer with the given Formatter.
      int getCurrentLineNumber()
      Returns the line number of the last character in the buffer.
      protected java.lang.String getLastLineInBuffer()  
      int getOffset()
      Returns the size of the buffer.
      void print​(java.lang.Object o)
      Appends a string representation of the given object to the buffer.
      void printdyn​(java.lang.Object o)
      Appends a string representation of the given object to the buffer, correcting the indentation of the string representation to match the indentation level of the previous line in the buffer.
      void println()
      Appends a new line the buffer.
      protected void replaceContentsWith​(java.lang.String newContents)  
      void setContentType​(java.lang.String name)
      Specifies the type of output in the buffer, such as Java or HTML.
      java.lang.String startControl​(java.lang.String id, boolean enabled)
      Appends the starting tag for a controlled region to the buffer.
      java.lang.String startControl​(java.lang.String startComment, java.lang.String endComment, java.lang.String id, boolean enabled)
      Appends the starting tag for a protected region to the buffer.
      java.lang.String startLocate​(java.lang.String id, boolean enabled, RegionType regionType)  
      java.lang.String startLocate​(java.lang.String startComment, java.lang.String endComment, java.lang.String id, boolean enabled, RegionType regionType)  
      java.lang.String startPreserve​(java.lang.String id, boolean enabled)
      Appends the starting tag for a protected region to the buffer.
      java.lang.String startPreserve​(java.lang.String startComment, java.lang.String endComment, java.lang.String id, boolean enabled)
      Appends the starting tag for a protected region to the buffer.
      void stop()
      Halts execution of the current template.
      java.lang.String stopControl()
      Appends a closing tag for a protected region to the buffer.
      java.lang.String stopLocate()  
      java.lang.String stopPreserve()
      Appends a closing tag for a protected region to the buffer.
      java.lang.String toString()
      Converts the contents of the buffer to a string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • buffer

        protected java.lang.StringBuffer buffer
      • contentTypeSet

        protected boolean contentTypeSet
      • lastLine

        protected java.lang.String lastLine
      • hasProtectedRegions

        protected boolean hasProtectedRegions
      • hasControlledRegions

        protected boolean hasControlledRegions
    • Constructor Detail

      • OutputBuffer

        public OutputBuffer​(IEglContext context)
      • OutputBuffer

        public OutputBuffer()
    • Method Detail

      • chop

        public void chop​(int chars)
        Description copied from interface: IOutputBuffer
        Removes the specified number of characters from the end of the buffer.
        Specified by:
        chop in interface IOutputBuffer
      • print

        public void print​(java.lang.Object o)
        Description copied from interface: IOutputBuffer
        Appends a string representation of the given object to the buffer.
        Specified by:
        print in interface IOutputBuffer
      • printdyn

        public void printdyn​(java.lang.Object o)
        Description copied from interface: IOutputBuffer
        Appends a string representation of the given object to the buffer, correcting the indentation of the string representation to match the indentation level of the previous line in the buffer. Used to output EGL dynamic sections.
        Specified by:
        printdyn in interface IOutputBuffer
      • getLastLineInBuffer

        protected java.lang.String getLastLineInBuffer()
      • calculateIndentationToMatch

        protected java.lang.String calculateIndentationToMatch​(java.lang.String previousLine)
      • println

        public void println()
        Description copied from interface: IOutputBuffer
        Appends a new line the buffer.
        Specified by:
        println in interface IOutputBuffer
      • startControl

        public java.lang.String startControl​(java.lang.String startComment,
                                             java.lang.String endComment,
                                             java.lang.String id,
                                             boolean enabled)
                                      throws EglRuntimeException
        Description copied from interface: IOutputBuffer
        Appends the starting tag for a protected region to the buffer.
        Specified by:
        startControl in interface IOutputBuffer
        Parameters:
        startComment - - the character sequence used to denote the start of a comment for the type of output in the buffer
        endComment - - the character sequence used to denote the end of a comment for the type of output in the buffer
        id - - a unique identifier for this protected region
        enabled - - a flag indicating whether protection of text in this region should be enabled or not
        Throws:
        EglRuntimeException
      • startPreserve

        public java.lang.String startPreserve​(java.lang.String startComment,
                                              java.lang.String endComment,
                                              java.lang.String id,
                                              boolean enabled)
                                       throws EglRuntimeException
        Description copied from interface: IOutputBuffer
        Appends the starting tag for a protected region to the buffer.
        Specified by:
        startPreserve in interface IOutputBuffer
        Parameters:
        startComment - - the character sequence used to denote the start of a comment for the type of output in the buffer
        endComment - - the character sequence used to denote the end of a comment for the type of output in the buffer
        id - - a unique identifier for this protected region
        enabled - - a flag indicating whether protection of text in this region should be enabled or not
        Throws:
        EglRuntimeException
      • getCurrentLineNumber

        public int getCurrentLineNumber()
        Description copied from interface: IOutputBuffer
        Returns the line number of the last character in the buffer.
        Specified by:
        getCurrentLineNumber in interface IOutputBuffer
      • replaceContentsWith

        protected void replaceContentsWith​(java.lang.String newContents)
      • toString

        public java.lang.String toString()
        Description copied from interface: IOutputBuffer
        Converts the contents of the buffer to a string.
        Specified by:
        toString in interface IOutputBuffer
        Overrides:
        toString in class java.lang.Object