Class SmapGenerator


  • public class SmapGenerator
    extends java.lang.Object
    Represents a source map (SMAP), which serves to associate lines of the input JSP file(s) to lines in the generated servlet in the final .class file, according to the JSR-045 spec.
    • Constructor Summary

      Constructors 
      Constructor Description
      SmapGenerator()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSmap​(java.lang.String smap, java.lang.String stratumName)
      Adds the given string as an embedded SMAP with the given stratum name.
      void addStratum​(SmapStratum stratum, boolean defaultStratum)
      Adds the given SmapStratum object, representing a Stratum with logically associated FileSection and LineSection blocks, to the current SmapGenerator.
      java.lang.String getString()  
      static void main​(java.lang.String[] args)  
      void setDoEmbedded​(boolean status)
      Instructs the SmapGenerator whether to actually print any embedded SMAPs or not.
      void setOutputFileName​(java.lang.String x)
      Sets the filename (without path information) for the generated source file.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • outputFileName

        private java.lang.String outputFileName
      • defaultStratum

        private java.lang.String defaultStratum
      • embedded

        private java.util.List<java.lang.String> embedded
      • doEmbedded

        private boolean doEmbedded
    • Constructor Detail

      • SmapGenerator

        public SmapGenerator()
    • Method Detail

      • setOutputFileName

        public void setOutputFileName​(java.lang.String x)
        Sets the filename (without path information) for the generated source file. E.g., "foo$jsp.java".
      • addStratum

        public void addStratum​(SmapStratum stratum,
                               boolean defaultStratum)
        Adds the given SmapStratum object, representing a Stratum with logically associated FileSection and LineSection blocks, to the current SmapGenerator. If default is true, this stratum is made the default stratum, overriding any previously set default.
        Parameters:
        stratum - the SmapStratum object to add
        defaultStratum - if true, this SmapStratum is considered to represent the default SMAP stratum unless overwritten
      • addSmap

        public void addSmap​(java.lang.String smap,
                            java.lang.String stratumName)
        Adds the given string as an embedded SMAP with the given stratum name.
        Parameters:
        smap - the SMAP to embed
        stratumName - the name of the stratum output by the compilation that produced the smap to be embedded
      • setDoEmbedded

        public void setDoEmbedded​(boolean status)
        Instructs the SmapGenerator whether to actually print any embedded SMAPs or not. Intended for situations without an SMAP resolver.
        Parameters:
        status - If false, ignore any embedded SMAPs.
      • getString

        public java.lang.String getString()
      • toString

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

        public static void main​(java.lang.String[] args)