java.lang.Object
org.glavo.classfile.impl.AbstractElement
org.glavo.classfile.impl.ClassImpl
- All Implemented Interfaces:
Iterable<ClassElement>,AttributedElement,ClassfileElement,ClassModel,CompoundElement<ClassElement>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the attributes of this element.Returns the constant pool for this class.fields()Returns the fields of this class.flags()Returns the access flags.voidforEachElement(Consumer<ClassElement> consumer) Invoke the provided handler with each element contained in this compound elementReturns the interfaces implemented by this class.booleanReturns whether this class is a module descriptor.intReturns the major classfile version.methods()Returns the methods of this class.intReturns the minor classfile version.Returns the superclass of this class, if there is one.Returns the constant pool entry describing the name of this class.toString()byte[]transform(ClassTransform transform) Transform this classfile into a new classfile with the aid of aClassTransform.Methods inherited from class org.glavo.classfile.impl.AbstractElement
writeTo, writeTo, writeTo, writeToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.glavo.classfile.AttributedElement
findAttribute, findAttributesMethods inherited from interface org.glavo.classfile.ClassModel
verify, verifyMethods inherited from interface org.glavo.classfile.CompoundElement
elementList, elements, elementStream, iteratorMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ClassImpl
-
-
Method Details
-
flags
Description copied from interface:ClassModelReturns the access flags.- Specified by:
flagsin interfaceClassModel- Returns:
- the access flags
-
majorVersion
public int majorVersion()Description copied from interface:ClassModelReturns the major classfile version.- Specified by:
majorVersionin interfaceClassModel- Returns:
- the major classfile version
-
minorVersion
public int minorVersion()Description copied from interface:ClassModelReturns the minor classfile version.- Specified by:
minorVersionin interfaceClassModel- Returns:
- the minor classfile version
-
constantPool
Description copied from interface:ClassModelReturns the constant pool for this class.- Specified by:
constantPoolin interfaceClassModel- Returns:
- the constant pool for this class
-
thisClass
Description copied from interface:ClassModelReturns the constant pool entry describing the name of this class.- Specified by:
thisClassin interfaceClassModel- Returns:
- the constant pool entry describing the name of this class
-
superclass
Description copied from interface:ClassModelReturns the superclass of this class, if there is one.- Specified by:
superclassin interfaceClassModel- Returns:
- the superclass of this class, if there is one
-
interfaces
Description copied from interface:ClassModelReturns the interfaces implemented by this class.- Specified by:
interfacesin interfaceClassModel- Returns:
- the interfaces implemented by this class
-
attributes
Description copied from interface:AttributedElementReturns the attributes of this element.- Specified by:
attributesin interfaceAttributedElement- Returns:
- the attributes of this element
-
forEachElement
Description copied from interface:CompoundElementInvoke the provided handler with each element contained in this compound element- Specified by:
forEachElementin interfaceCompoundElement<ClassElement>- Parameters:
consumer- the handler
-
transform
Description copied from interface:ClassModelTransform this classfile into a new classfile with the aid of aClassTransform. The transform will receive each element of this class, as well as aClassBuilderfor building the new class. The transform is free to preserve, remove, or replace elements as it sees fit.- Specified by:
transformin interfaceClassModel- Parameters:
transform- the transform- Returns:
- the bytes of the new class
-
fields
Description copied from interface:ClassModelReturns the fields of this class.- Specified by:
fieldsin interfaceClassModel- Returns:
- the fields of this class
-
methods
Description copied from interface:ClassModelReturns the methods of this class.- Specified by:
methodsin interfaceClassModel- Returns:
- the methods of this class
-
isModuleInfo
public boolean isModuleInfo()Description copied from interface:ClassModelReturns whether this class is a module descriptor.- Specified by:
isModuleInfoin interfaceClassModel- Returns:
- whether this class is a module descriptor
-
toString
-