Class JavaNames
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.java.JavaNames
-
Field Summary
Modifier and TypeFieldDescriptionstatic char[]
static char[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic char[]
binaryNameToFieldDescriptor(char[] binaryName)
Converts a binary name to a field descriptor (without the trailing ';')static char[]
binaryNameToFullyQualifiedName(char[] binaryName)
static char[]
binaryNameToResourceRelativePath(char[] binaryName)
Given the binary name of a class, returns the jar-relative path of the class file within that jar, including the .class extension.static char[]
binaryNameToSimpleName(char[] binaryName)
Converts a java binary name to a simple name.static String
classFilePathToBinaryName(String classFilePath)
static char[]
fieldDescriptorToBinaryName(char[] fieldDescriptor)
Given a field descriptor, if the field descriptor points to a class this returns the binary name of the class.static char[]
fieldDescriptorToJavaName(char[] fieldDescriptor, boolean fullyQualified)
Converts a field descriptor to a java name.static char[]
fieldDescriptorToSimpleName(char[] fieldDescriptor)
Converts a field descriptor to a simple class name.static char[]
fullyQualifiedNameToBinaryName(char[] fullyQualifiedName)
static char[]
fullyQualifiedNameToFieldDescriptor(char[] fullyQualifiedName)
static char[]
getIndexPathFor(NdType type, org.eclipse.core.resources.IWorkspaceRoot root)
Given a NdType, returns its identifier in the form accepted byIJavaSearchScope.encloses(String)
static char[]
getMethodId(char[] parentTypeBinaryName, char[] methodSelectorAndDescriptor)
Returns a method id given a field descriptor for its parent type and a combined method selector and method descriptor for the methodstatic char[]
getMethodId(char[] parentTypeBinaryName, char[] methodSelector, char[] methodDescriptor)
static char[]
simpleNameToSourceName(char[] chars)
Given a simple name, this returns the source name for the type.
-
Field Details
-
FIELD_DESCRIPTOR_PREFIX
public static final char[] FIELD_DESCRIPTOR_PREFIX -
ARRAY_FIELD_DESCRIPTOR_PREFIX
public static final char[] ARRAY_FIELD_DESCRIPTOR_PREFIX
-
-
Constructor Details
-
JavaNames
public JavaNames()
-
-
Method Details
-
binaryNameToSimpleName
public static char[] binaryNameToSimpleName(char[] binaryName)Converts a java binary name to a simple name. -
binaryNameToResourceRelativePath
public static char[] binaryNameToResourceRelativePath(char[] binaryName)Given the binary name of a class, returns the jar-relative path of the class file within that jar, including the .class extension. -
fullyQualifiedNameToBinaryName
public static char[] fullyQualifiedNameToBinaryName(char[] fullyQualifiedName) -
fullyQualifiedNameToFieldDescriptor
public static char[] fullyQualifiedNameToFieldDescriptor(char[] fullyQualifiedName) -
getIndexPathFor
Given a NdType, returns its identifier in the form accepted byIJavaSearchScope.encloses(String)
-
binaryNameToFieldDescriptor
public static char[] binaryNameToFieldDescriptor(char[] binaryName)Converts a binary name to a field descriptor (without the trailing ';') -
fieldDescriptorToSimpleName
public static char[] fieldDescriptorToSimpleName(char[] fieldDescriptor)Converts a field descriptor to a simple class name. Returns null if the given field descriptor doesn't refer to a class or is badly-formed. -
fieldDescriptorToJavaName
public static char[] fieldDescriptorToJavaName(char[] fieldDescriptor, boolean fullyQualified)Converts a field descriptor to a java name. If fullyQualified is true, it returns a fully qualified class name. If it is false, it returns a source name. -
binaryNameToFullyQualifiedName
public static char[] binaryNameToFullyQualifiedName(char[] binaryName) -
getMethodId
public static char[] getMethodId(char[] parentTypeBinaryName, char[] methodSelectorAndDescriptor)Returns a method id given a field descriptor for its parent type and a combined method selector and method descriptor for the method- Parameters:
parentTypeBinaryName
- a field descriptor of the sort returned by the other *ToFieldDescriptor methods.methodSelectorAndDescriptor
- a method selector and descriptor of the form returned byIBinaryType.getEnclosingMethod()
- Returns:
- a method id
-
getMethodId
public static char[] getMethodId(char[] parentTypeBinaryName, char[] methodSelector, char[] methodDescriptor) -
fieldDescriptorToBinaryName
public static char[] fieldDescriptorToBinaryName(char[] fieldDescriptor)Given a field descriptor, if the field descriptor points to a class this returns the binary name of the class. If the field descriptor points to any other type, this returns the empty string. The field descriptor may optionally contain a trailing ';'.- Parameters:
fieldDescriptor
-- Returns:
- ""
-
simpleNameToSourceName
public static char[] simpleNameToSourceName(char[] chars)Given a simple name, this returns the source name for the type. Note that this won't work for classes that contain a $ in their source name. -
classFilePathToBinaryName
-