Class UserClassInfo


  • public class UserClassInfo
    extends java.lang.Object
    Class UserClassInfo is used by the JTB driver, the visitors and the files generator to store and retrieve information about a (grammar) user (node) class including its name, the list of its fields, its comments. It is also used to generate the user node class code.

    Class and inner classes maintain state (for a user class), and are not supposed to be run in parallel threads (on the same user class).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      INode astEcNode
      The corresponding ExpansionChoices node
      java.lang.String className
      The class name (without optional prefix and suffix)
      java.util.List<UserClassInfo.CommentData> fieldCmts
      The list of the field comments data
      java.util.List<UserClassInfo.FieldInfo> fields
      The list of the class fields representing the node's children
      int fieldsHashSig
      The fields hash signature (for helping controlling changes between generated classes versions).
      java.util.List<UserClassInfo.CommentData> fieldSubCmts
      The list of the sub comments data (without field comments data).
      Built and used only when the "inline accept methods" option is on.
      java.lang.String fixedClassName
      The class name (including optional prefix and suffix)
      java.lang.StringBuilder visitFieldCmtsSb
      The javadoc formatted field comments used by the visit methods (more than once, so that's why they are stored as an optimization)
    • Constructor Summary

      Constructors 
      Constructor Description
      UserClassInfo​(ExpansionChoices aEC, int aNbFields, java.lang.String aCN, java.lang.String aFCN)
      Constructs an instance giving an ExpansionChoices node and a name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addField​(java.lang.String aFT, java.lang.String aFN)
      Adds a field type, name (with no initializer) to the internal lists.
      void addField​(java.lang.String aFT, java.lang.String aFFT, java.lang.String aFN)
      Adds a field type, name, initializer, code and node to the internal lists.
      • Methods inherited from class java.lang.Object

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

      • astEcNode

        public final INode astEcNode
        The corresponding ExpansionChoices node
      • className

        public final java.lang.String className
        The class name (without optional prefix and suffix)
      • fixedClassName

        public final java.lang.String fixedClassName
        The class name (including optional prefix and suffix)
      • fields

        public final java.util.List<UserClassInfo.FieldInfo> fields
        The list of the class fields representing the node's children
      • fieldSubCmts

        public java.util.List<UserClassInfo.CommentData> fieldSubCmts
        The list of the sub comments data (without field comments data).
        Built and used only when the "inline accept methods" option is on.
      • fieldsHashSig

        public int fieldsHashSig
        The fields hash signature (for helping controlling changes between generated classes versions). Null if no fields.
      • visitFieldCmtsSb

        public java.lang.StringBuilder visitFieldCmtsSb
        The javadoc formatted field comments used by the visit methods (more than once, so that's why they are stored as an optimization)
    • Constructor Detail

      • UserClassInfo

        public UserClassInfo​(ExpansionChoices aEC,
                             int aNbFields,
                             java.lang.String aCN,
                             java.lang.String aFCN)
        Constructs an instance giving an ExpansionChoices node and a name.
        Parameters:
        aEC - - the ExpansionChoices node
        aNbFields - - the number of fields
        aCN - - the class name
        aFCN - - the fixed name of the class name
    • Method Detail

      • addField

        public void addField​(java.lang.String aFT,
                             java.lang.String aFN)
        Adds a field type, name (with no initializer) to the internal lists.
        Parameters:
        aFT - - the field type
        aFN - - the field name
      • addField

        public void addField​(java.lang.String aFT,
                             java.lang.String aFFT,
                             java.lang.String aFN)
        Adds a field type, name, initializer, code and node to the internal lists.
        Parameters:
        aFT - - the field type
        aFFT - - the fixed name of the field type
        aFN - - the field name