APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.bcel.internal.classfile

public final Class Signature

extends Attribute
Class Inheritance
Imports
java.io.ByteArrayInputStream, .DataInput, .DataOutputStream, .IOException, java.nio.charset.StandardCharsets, java.util.Objects, com.sun.org.apache.bcel.internal.Const, com.sun.org.apache.bcel.internal.util.Args

This class is derived from Attribute and represents a reference to a GJ attribute.
See Also
Attribute

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
Signature.MyByteArrayInputStream

Extends ByteArrayInputStream to make 'unreading' chars possible.

Field Summary

Modifier and TypeField and Description
private int
Inherited from com.sun.org.apache.bcel.internal.classfile.Attribute:
constant_poolEMPTY_ARRAYlengthname_indextag

Constructor Summary

AccessConstructor and Description
pack-priv
Signature(final int
Index in constant pool to CONSTANT_Utf8
nameIndex
,
final int
Content length in bytes
length
,
final DataInput
Input stream
input
,
final ConstantPool
Array of constants
constantPool
)

Constructs object from file stream.

public
Signature(final int
Index in constant pool to CONSTANT_Utf8
nameIndex
,
final int
Content length in bytes
length
,
final int
Index in constant pool to CONSTANT_Utf8
signatureIndex
,
final ConstantPool
Array of constants
constantPool
)

public
Signature(final Signature
Source to copy.
c
)

Initialize from another object.

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements abstract com.sun.org.apache.bcel.internal.classfile.Attribute.accept.

Implements com.sun.org.apache.bcel.internal.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.

public Attribute
copy(final ConstantPool constantPool)

Implements abstract com.sun.org.apache.bcel.internal.classfile.Attribute.copy.

Returns: deep copy of this attribute

public void
dump(final DataOutputStream
Output file stream
file
)

Overrides com.sun.org.apache.bcel.internal.classfile.Attribute.dump.

Dump source file attribute to file stream in binary format.

public String
getSignature()

Returns: GJ signature.

public int
getSignatureIndex()

Returns: Index in constant pool of source file name.

private static boolean
identStart(final int ch)

public static boolean
public static boolean
private static void
private static void
public void
setSignatureIndex(final int
the index info the constant pool of this signature
signatureIndex
)

public String

Returns:

String representation
toString
()

Overrides com.sun.org.apache.bcel.internal.classfile.Attribute.toString.

Returns a string representation of the object.

public static String
translate(final String s)

Inherited from com.sun.org.apache.bcel.internal.classfile.Attribute:
addAttributeReaderclonegetConstantPoolgetLengthgetNamegetNameIndexgetTagprintlnreadAttributereadAttributeremoveAttributeReadersetConstantPoolsetLengthsetNameIndex

Field Detail

signatureIndexback to summary
private int signatureIndex

Constructor Detail

Signatureback to summary
pack-priv Signature(final int nameIndex, final int length, final DataInput input, final ConstantPool constantPool) throws IOException

Constructs object from file stream.

Parameters
nameIndex:int

Index in constant pool to CONSTANT_Utf8

length:int

Content length in bytes

input:DataInput

Input stream

constantPool:ConstantPool

Array of constants

Exceptions
IOException:
if an I/O error occurs.
Signatureback to summary
public Signature(final int nameIndex, final int length, final int signatureIndex, final ConstantPool constantPool)
Parameters
nameIndex:int

Index in constant pool to CONSTANT_Utf8

length:int

Content length in bytes

signatureIndex:int

Index in constant pool to CONSTANT_Utf8

constantPool:ConstantPool

Array of constants

Signatureback to summary
public Signature(final Signature c)

Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

Parameters
c:Signature

Source to copy.

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract com.sun.org.apache.bcel.internal.classfile.Attribute.accept.

Implements com.sun.org.apache.bcel.internal.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters
v:Visitor

Visitor object

Annotations
@Override
copyback to summary
public Attribute copy(final ConstantPool constantPool)

Implements abstract com.sun.org.apache.bcel.internal.classfile.Attribute.copy.

Returns:Attribute

deep copy of this attribute

Annotations
@Override
dumpback to summary
public void dump(final DataOutputStream file) throws IOException

Overrides com.sun.org.apache.bcel.internal.classfile.Attribute.dump.

Dump source file attribute to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getSignatureback to summary
public String getSignature()
Returns:String

GJ signature.

getSignatureIndexback to summary
public int getSignatureIndex()
Returns:int

Index in constant pool of source file name.

identStartback to summary
private static boolean identStart(final int ch)
isActualParameterListback to summary
public static boolean isActualParameterList(final String s)
isFormalParameterListback to summary
public static boolean isFormalParameterList(final String s)
matchGJIdentback to summary
private static void matchGJIdent(final Signature.MyByteArrayInputStream in, final StringBuilder buf)
matchIdentback to summary
private static void matchIdent(final Signature.MyByteArrayInputStream in, final StringBuilder buf)
setSignatureIndexback to summary
public void setSignatureIndex(final int signatureIndex)
Parameters
signatureIndex:int

the index info the constant pool of this signature

toStringback to summary
public String toString()

Overrides com.sun.org.apache.bcel.internal.classfile.Attribute.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

String representation

Annotations
@Override
translateback to summary
public static String translate(final String s)
com.sun.org.apache.bcel.internal.classfile back to summary

private final Class Signature.MyByteArrayInputStream

extends ByteArrayInputStream
Class Inheritance

Extends ByteArrayInputStream to make 'unreading' chars possible.

Field Summary

Inherited from java.io.ByteArrayInputStream:
bufcountmarkpos

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv String
pack-priv void
Inherited from java.io.ByteArrayInputStream:
availableclosemarkmarkSupportedreadreadreadAllBytesreadNBytesresetskiptransferTo

Constructor Detail

MyByteArrayInputStreamback to summary
pack-priv MyByteArrayInputStream(final String data)

Method Detail

getDataback to summary
pack-priv String getData()
unreadback to summary
pack-priv void unread()