Class SerializableDecorator

  • All Implemented Interfaces:
    ClassDecorator

    public class SerializableDecorator
    extends java.lang.Object
    implements ClassDecorator
    Code generation decorator which adds the java.lang.Serializable interface to each class, and optionally also adds a private static final long serialVersionUID value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ASTParser m_parser
      Parser instance used by class.
      private java.lang.Long m_serialVersion
      Serial version UID value (null if not set).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void finish​(ElementBase binding, IClassHolder holder)
      Method called after completing code generation for the target class.
      void setSerialVersion​(java.lang.Long version)
      Set serial version.
      void start​(IClassHolder holder)
      Method called before starting code generation for the target class.
      void valueAdded​(java.lang.String basename, boolean collect, java.lang.String type, FieldDeclaration field, MethodDeclaration getmeth, MethodDeclaration setmeth, java.lang.String descript, IClassHolder holder)
      Method called after adding each data value to class.
      • Methods inherited from class java.lang.Object

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

      • m_parser

        private final ASTParser m_parser
        Parser instance used by class.
      • m_serialVersion

        private java.lang.Long m_serialVersion
        Serial version UID value (null if not set).
    • Constructor Detail

      • SerializableDecorator

        public SerializableDecorator()
    • Method Detail

      • setSerialVersion

        public void setSerialVersion​(java.lang.Long version)
        Set serial version.
        Parameters:
        version -
      • finish

        public void finish​(ElementBase binding,
                           IClassHolder holder)
        Method called after completing code generation for the target class.
        Specified by:
        finish in interface ClassDecorator
        Parameters:
        binding -
        holder -
      • start

        public void start​(IClassHolder holder)
        Method called before starting code generation for the target class.
        Specified by:
        start in interface ClassDecorator
        Parameters:
        holder -
      • valueAdded

        public void valueAdded​(java.lang.String basename,
                               boolean collect,
                               java.lang.String type,
                               FieldDeclaration field,
                               MethodDeclaration getmeth,
                               MethodDeclaration setmeth,
                               java.lang.String descript,
                               IClassHolder holder)
        Method called after adding each data value to class.
        Specified by:
        valueAdded in interface ClassDecorator
        Parameters:
        basename - base name used for data value
        collect - repeated value flag
        type - value type (item value type, in the case of a repeated value)
        field - actual field
        getmeth - read access method
        setmeth - write access method
        descript - value description text
        holder -