/** * This method is used to fully initialize the contents of the receiver. All methodinfos, fields infos * will be therefore fully initialized and we can get rid of the bytes. */ void initialize() { getModifiers(); getName(); getSourceName(); getEnclosingTypeName(); reset(); } }
@Override public char[] getName() { if (!this.readInnerClassName) { // read the inner class name this.readInnerClassName = true; if (this.innerClassNameIndex != 0) { int classOffset = this.constantPoolOffsets[this.innerClassNameIndex] - this.structOffset; int utf8Offset = this.constantPoolOffsets[u2At(classOffset + 1)] - this.structOffset; this.innerClassName = utf8At(utf8Offset + 3, u2At(utf8Offset + 1)); } } return this.innerClassName; } /**
/** * Answer true if the receiver is a local type, false otherwise * * @return <CODE>boolean</CODE> */ public boolean isLocal() { if (this.innerInfo == null) return false; if (this.innerInfo.getEnclosingTypeName() != null) return false; char[] innerSourceName = this.innerInfo.getSourceName(); return (innerSourceName != null && innerSourceName.length > 0); }
/** * Answer the string representation of the receiver * @return java.lang.String */ public String toString() { StringBuffer buffer = new StringBuffer(); if (getName() != null) { buffer.append(getName()); } buffer.append("\n"); //$NON-NLS-1$ if (getEnclosingTypeName() != null) { buffer.append(getEnclosingTypeName()); } buffer.append("\n"); //$NON-NLS-1$ if (getSourceName() != null) { buffer.append(getSourceName()); } return buffer.toString(); } /**
for (int j = 0; j < number_of_classes; j++) { this.innerInfos[j] = new InnerClassInfo(this.reference, this.constantPoolOffsets, innerOffset); if (this.classNameIndex == this.innerInfos[j].innerClassNameIndex) { this.innerInfo = this.innerInfos[j]; char[] enclosingType = this.innerInfo.getEnclosingTypeName(); if (enclosingType != null) { this.enclosingTypeName = enclosingType;
/** * This method is used to fully initialize the contents of the receiver. All methodinfos, fields infos * will be therefore fully initialized and we can get rid of the bytes. */ private void initialize() throws ClassFormatException { try { for (int i = 0, max = this.fieldsCount; i < max; i++) { this.fields[i].initialize(); } for (int i = 0, max = this.methodsCount; i < max; i++) { this.methods[i].initialize(); } if (this.innerInfos != null) { for (int i = 0, max = this.innerInfos.length; i < max; i++) { this.innerInfos[i].initialize(); } } if (this.annotations != null) { for (int i = 0, max = this.annotations.length; i < max; i++) { this.annotations[i].initialize(); } } this.getEnclosingMethod(); reset(); } catch(RuntimeException e) { ClassFormatException exception = new ClassFormatException(e, this.classFileName); throw exception; } }
/** * Answer an int whose bits are set according the access constants * defined by the VM spec. * Set the AccDeprecated and AccSynthetic bits if necessary * @return int */ public int getModifiers() { if (this.innerInfo != null) { return this.innerInfo.getModifiers() | (this.accessFlags & ClassFileConstants.AccDeprecated); } return this.accessFlags; }
@Override public boolean isAnonymous() { if (this.innerInfo == null) return false; char[] innerSourceName = this.innerInfo.getSourceName(); return (innerSourceName == null || innerSourceName.length == 0); }
/** * Answer the string representation of the receiver * @return java.lang.String */ public String toString() { StringBuffer buffer = new StringBuffer(); if (getName() != null) { buffer.append(getName()); } buffer.append("\n"); //$NON-NLS-1$ if (getEnclosingTypeName() != null) { buffer.append(getEnclosingTypeName()); } buffer.append("\n"); //$NON-NLS-1$ if (getSourceName() != null) { buffer.append(getSourceName()); } return buffer.toString(); } /**
/** * Answer true if the receiver is a member type, false otherwise * * @return <CODE>boolean</CODE> */ public boolean isMember() { if (this.innerInfo == null) return false; if (this.innerInfo.getEnclosingTypeName() == null) return false; char[] innerSourceName = this.innerInfo.getSourceName(); return (innerSourceName != null && innerSourceName.length > 0); // protection against ill-formed attributes (67600) }
for (int j = 0; j < number_of_classes; j++) { this.innerInfos[j] = new InnerClassInfo(this.reference, this.constantPoolOffsets, innerOffset); if (this.classNameIndex == this.innerInfos[j].innerClassNameIndex) { this.innerInfo = this.innerInfos[j]; char[] enclosingType = this.innerInfo.getEnclosingTypeName(); if (enclosingType != null) { this.enclosingTypeName = enclosingType;
/** * This method is used to fully initialize the contents of the receiver. All methodinfos, fields infos * will be therefore fully initialized and we can get rid of the bytes. */ private void initialize() throws ClassFormatException { try { for (int i = 0, max = this.fieldsCount; i < max; i++) { this.fields[i].initialize(); } for (int i = 0, max = this.methodsCount; i < max; i++) { this.methods[i].initialize(); } if (this.innerInfos != null) { for (int i = 0, max = this.innerInfos.length; i < max; i++) { this.innerInfos[i].initialize(); } } if (this.annotations != null) { for (int i = 0, max = this.annotations.length; i < max; i++) { this.annotations[i].initialize(); } } this.getEnclosingMethod(); reset(); } catch(RuntimeException e) { ClassFormatException exception = new ClassFormatException(e, this.classFileName); throw exception; } }
/** * Answer an int whose bits are set according the access constants * defined by the VM spec. * Set the AccDeprecated and AccSynthetic bits if necessary * @return int */ public int getModifiers() { int modifiers; if (this.innerInfo != null) { modifiers = this.innerInfo.getModifiers() | (this.accessFlags & ClassFileConstants.AccDeprecated) | (this.accessFlags & ClassFileConstants.AccSynthetic); } else { modifiers = this.accessFlags; } return modifiers; }
/** * This method is used to fully initialize the contents of the receiver. All methodinfos, fields infos * will be therefore fully initialized and we can get rid of the bytes. */ void initialize() { getModifiers(); getName(); getSourceName(); getEnclosingTypeName(); reset(); } }
/** * Answer the string representation of the receiver * @return java.lang.String */ public String toString() { StringBuffer buffer = new StringBuffer(); if (getName() != null) { buffer.append(getName()); } buffer.append("\n"); //$NON-NLS-1$ if (getEnclosingTypeName() != null) { buffer.append(getEnclosingTypeName()); } buffer.append("\n"); //$NON-NLS-1$ if (getSourceName() != null) { buffer.append(getSourceName()); } return buffer.toString(); } /**
@Override public char[] getEnclosingTypeName() { if (!this.readOuterClassName) { // read outer class name this.readOuterClassName = true; if (this.outerClassNameIndex != 0) { int utf8Offset = this.constantPoolOffsets[u2At( this.constantPoolOffsets[this.outerClassNameIndex] - this.structOffset + 1)] - this.structOffset; this.outerClassName = utf8At(utf8Offset + 3, u2At(utf8Offset + 1)); } } return this.outerClassName; }
@Override public boolean isMember() { if (this.innerInfo == null) return false; if (this.innerInfo.getEnclosingTypeName() == null) return false; char[] innerSourceName = this.innerInfo.getSourceName(); return (innerSourceName != null && innerSourceName.length > 0); // protection against ill-formed attributes (67600) }
for (int j = 0; j < number_of_classes; j++) { this.innerInfos[j] = new InnerClassInfo(this.reference, this.constantPoolOffsets, innerOffset); if (this.classNameIndex == this.innerInfos[j].innerClassNameIndex) { this.innerInfo = this.innerInfos[j]; char[] enclosingType = this.innerInfo.getEnclosingTypeName(); if (enclosingType != null) { this.enclosingTypeName = enclosingType;