org.stringtemplate.v4.debug
Class DebugST

java.lang.Object
  extended by org.stringtemplate.v4.ST
      extended by org.stringtemplate.v4.debug.DebugST

public class DebugST
extends ST

To avoid polluting ST instances with debug info when not debugging. Setting debug mode in STGroup makes it create these instead of STs.


Nested Class Summary
static class DebugST.State
           
 
Nested classes/interfaces inherited from class org.stringtemplate.v4.ST
ST.AttributeList<T>, ST.RegionType
 
Field Summary
 MultiMap<java.lang.String,AddAttributeEvent> addAttrEvents
          Track construction-time add attribute "events"; used for ST user-level debugging
 ConstructionEvent newSTEvent
          Record who made us? ConstructionEvent creates Exception to grab stack
 
Fields inherited from class org.stringtemplate.v4.ST
cachedNoSuchPropException, EMPTY_ATTR, enclosingInstance, groupThatCreatedThisInstance, impl, locals, UNKNOWN_NAME, VERSION
 
Constructor Summary
DebugST()
           
DebugST(ST proto)
           
 
Method Summary
 ST add(java.lang.String name, java.lang.Object value)
          Inject an attribute (name/value pair).
 java.util.List<InterpEvent> getEvents()
           
 java.util.List<InterpEvent> getEvents(int lineWidth)
           
 java.util.List<InterpEvent> getEvents(java.util.Locale locale)
           
 java.util.List<InterpEvent> getEvents(java.util.Locale locale, int lineWidth)
           
 java.util.List<InterpEvent> inspect()
           
 java.util.List<InterpEvent> inspect(ErrorManager errMgr, java.util.Locale locale, int lineWidth)
           
 java.util.List<InterpEvent> inspect(int lineWidth)
           
 java.util.List<InterpEvent> inspect(java.util.Locale locale)
           
 
Methods inherited from class org.stringtemplate.v4.ST
convertToAttributeList, format, format, getAttribute, getAttributes, getEnclosingInstanceStack, getEnclosingInstanceStackString, getName, isAnonSubtemplate, rawSetAttribute, remove, render, render, render, render, toString, write, write, write, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

newSTEvent

public ConstructionEvent newSTEvent
Record who made us? ConstructionEvent creates Exception to grab stack


addAttrEvents

public MultiMap<java.lang.String,AddAttributeEvent> addAttrEvents
Track construction-time add attribute "events"; used for ST user-level debugging

Constructor Detail

DebugST

public DebugST()

DebugST

public DebugST(ST proto)
Method Detail

add

public ST add(java.lang.String name,
              java.lang.Object value)
Description copied from class: ST
Inject an attribute (name/value pair). If there is already an attribute with that name, this method turns the attribute into an AttributeList with both the previous and the new attribute as elements. This method will never alter a List that you inject. If you send in a List and then inject a single value element, add() copies original list and adds the new value. Return self so we can chain. t.add("x", 1).add("y", "hi");

Overrides:
add in class ST

inspect

public java.util.List<InterpEvent> inspect()

inspect

public java.util.List<InterpEvent> inspect(int lineWidth)

inspect

public java.util.List<InterpEvent> inspect(java.util.Locale locale)

inspect

public java.util.List<InterpEvent> inspect(ErrorManager errMgr,
                                           java.util.Locale locale,
                                           int lineWidth)

getEvents

public java.util.List<InterpEvent> getEvents()

getEvents

public java.util.List<InterpEvent> getEvents(int lineWidth)

getEvents

public java.util.List<InterpEvent> getEvents(java.util.Locale locale)

getEvents

public java.util.List<InterpEvent> getEvents(java.util.Locale locale,
                                             int lineWidth)


Copyright © 2011. All Rights Reserved.