Class AbstractAttributeMapper<T extends Attribute<T>>

java.lang.Object
org.glavo.classfile.impl.AbstractAttributeMapper<T>
All Implemented Interfaces:
AttributeMapper<T>

public abstract class AbstractAttributeMapper<T extends Attribute<T>> extends Object implements AttributeMapper<T>
  • Constructor Details

    • AbstractAttributeMapper

      public AbstractAttributeMapper(String name)
    • AbstractAttributeMapper

      public AbstractAttributeMapper(String name, boolean allowMultiple)
    • AbstractAttributeMapper

      public AbstractAttributeMapper(String name, int majorVersion)
    • AbstractAttributeMapper

      public AbstractAttributeMapper(String name, boolean allowMultiple, int majorVersion)
  • Method Details

    • writeBody

      protected abstract void writeBody(BufWriter buf, T attr)
    • name

      public String name()
      Description copied from interface: AttributeMapper
      Returns the name of the attribute.
      Specified by:
      name in interface AttributeMapper<T extends Attribute<T>>
      Returns:
      the name of the attribute
    • writeAttribute

      public void writeAttribute(BufWriter buf, T attr)
      Description copied from interface: AttributeMapper
      Write an Attribute instance to a classfile.
      Specified by:
      writeAttribute in interface AttributeMapper<T extends Attribute<T>>
      Parameters:
      buf - The BufWriter to which the attribute should be written
      attr - The attribute to write
    • allowMultiple

      public boolean allowMultiple()
      Description copied from interface: AttributeMapper
      Returns whether this attribute may appear more than once in a given location.
      Specified by:
      allowMultiple in interface AttributeMapper<T extends Attribute<T>>
      Returns:
      whether this attribute may appear more than once in a given location
    • validSince

      public int validSince()
      Description copied from interface: AttributeMapper
      Returns The earliest classfile version for which this attribute is applicable.
      Specified by:
      validSince in interface AttributeMapper<T extends Attribute<T>>
      Returns:
      The earliest classfile version for which this attribute is applicable
    • toString

      public String toString()
      Overrides:
      toString in class Object