Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.jdt.internal.core.hierarchy;
 
 
 public class HierarchyBinaryType implements IBinaryType {
 	private int modifiers;
 	private char[] sourceName;
 	private char[] name;
 	private char[] enclosingTypeName;
 	private char[] superclass;
 	private char[][] superInterfaces = ;
 	private char[][] typeParameterSignatures;
 	private char[] genericSignature;
 
 public HierarchyBinaryType(int modifierschar[] qualificationchar[] sourceNamechar[] enclosingTypeNamechar[][] typeParameterSignatureschar typeSuffix){
 
 	this. = modifiers;
 	this. = sourceName;
 	if (enclosingTypeName == null){
 		this. = CharOperation.concat(qualificationsourceName'/');
 	} else {
 		this. = CharOperation.concat(qualification'/'enclosingTypeName'$'sourceName); //rebuild A$B name
 		this. = CharOperation.concat(qualificationenclosingTypeName,'/');
 		CharOperation.replace(this.'.''/');
 	}
 	this. = typeParameterSignatures;
 	CharOperation.replace(this.'.''/');
 }
 
 	return null;
 }
 public char[] getEnclosingMethod() {
 	return null;
 }
Answer the resolved name of the enclosing type in the class file format as specified in section 4.2 of the Java 2 VM spec or null if the receiver is a top level type. For example, java.lang.String is java/lang/String.
 
 public char[] getEnclosingTypeName() {
 	return this.;
 }
Answer the receiver's fields or null if the array is empty.
 
 public IBinaryField[] getFields() {
 	return null;
 }
 
 public char[] getFileName() {
 	return null;
 }
 public char[] getGenericSignature() {
 	if (this. != null && this. == null) {
 		StringBuffer buffer = new StringBuffer();
 		buffer.append('<');
 		for (int i = 0, length = this..lengthi < lengthi++) {
 			buffer.append(this.[i]);
 		}
 		buffer.append('>');
 		if (this. == null)
 			buffer.append(Signature.createTypeSignature("java.lang.Object"true/*resolved*/)); //$NON-NLS-1$
 		else
 			buffer.append(Signature.createTypeSignature(this.true/*resolved*/));
 		if (this. != null)
 			for (int i = 0, length = this..lengthi < lengthi++)
 				buffer.append(Signature.createTypeSignature(this.[i], true/*resolved*/));
 		this. = buffer.toString().toCharArray();
 		CharOperation.replace(this.'.''/');
 	}
 	return this.;
 }
Answer the resolved names of the receiver's interfaces in the class file format as specified in section 4.2 of the Java 2 VM spec or null if the array is empty. For example, java.lang.String is java/lang/String.
public char[][] getInterfaceNames() {
	return this.;
Answer the receiver's nested types or null if the array is empty. This nested type info is extracted from the inner class attributes. Ask the name environment to find a member type using its compound name.
	return null;
Answer the receiver's methods or null if the array is empty.
	return null;
public char[][][] getMissingTypeNames() {
	return null;
Answer an int whose bits are set according the access constants defined by the VM spec.
public int getModifiers() {
	return this.;
Answer the resolved name of the type in the class file format as specified in section 4.2 of the Java 2 VM spec. For example, java.lang.String is java/lang/String.
public char[] getName() {
	return this.;
public char[] getSourceName() {
	return this.;
Answer the resolved name of the receiver's superclass in the class file format as specified in section 4.2 of the Java 2 VM spec or null if it does not have one. For example, java.lang.String is java/lang/String.
public char[] getSuperclassName() {
	return this.;
// TODO (jerome) please verify that we don't need the tagbits for the receiver
public long getTagBits() {
	return 0;
public boolean isAnonymous() {
	return false// index did not record this information (since unused for hierarchies)
Answer whether the receiver contains the resolved binary form or the unresolved source form of the type.
public boolean isBinaryType() {
	return true;
public boolean isLocal() {
	return false;  // index did not record this information (since unused for hierarchies)
public boolean isMember() {
	return false;  // index did not record this information (since unused for hierarchies)
public void recordSuperType(char[] superTypeNamechar[] superQualificationchar superClassOrInterface){
	// index encoding of p.A$B was B/p.A$, rebuild the proper name
	if (superQualification != null){
		int length = superQualification.length;
		if (superQualification[length-1] == '$'){
			char[] enclosingSuperName = CharOperation.lastSegment(superQualification'.');
			superTypeName = CharOperation.concat(enclosingSuperNamesuperTypeName);
			superQualification = CharOperation.subarray(superQualification, 0, length - enclosingSuperName.length - 1);
		}
	}
	if (superClassOrInterface == .){
		// interfaces are indexed as having superclass references to Object by default,
		// this is an artifact used for being able to query them only.
		if (TypeDeclaration.kind(this.) == .return;
		char[] encodedName = CharOperation.concat(superQualificationsuperTypeName'/');
		CharOperation.replace(encodedName'.''/');
		this. = encodedName;
else {
		char[] encodedName = CharOperation.concat(superQualificationsuperTypeName'/');
		CharOperation.replace(encodedName'.''/');
			this. = new char[][] { encodedName };
else {
			int length = this..length;
			System.arraycopy(this., 0, this. = new char[length+1][], 0, length);
			this.[length] = encodedName;
		}
	}
public char[] sourceFileName() {
	return null;
public String toString() {
	StringBuffer buffer = new StringBuffer();
		buffer.append("public "); //$NON-NLS-1$
	}
	switch (TypeDeclaration.kind(this.)) {
			buffer.append("class "); //$NON-NLS-1$
			break;
			buffer.append("interface "); //$NON-NLS-1$
			break;
			buffer.append("enum "); //$NON-NLS-1$
			break;
	}
	if (this. != null) {
		buffer.append(this.);
	}
	if (this. != null) {
		buffer.append("\n  extends "); //$NON-NLS-1$
		buffer.append(this.);
	}
	int length;
	if (this. != null && (length = this..length) != 0) {
		buffer.append("\n implements "); //$NON-NLS-1$
		for (int i = 0; i < lengthi++) {
			buffer.append(this.[i]);
			if (i != length - 1) {
				buffer.append(", "); //$NON-NLS-1$
			}
		}
	}
	return buffer.toString();
New to GrepCode? Check out our FAQ X