public boolean isConstructor() throws JavaModelException { if (!getElementName().equals(this.parent.getElementName())) { // faster than reaching the info return false; } IBinaryMethod info = (IBinaryMethod) getElementInfo(); return info.isConstructor(); } /*
@Override public boolean isConstructor() throws JavaModelException { if (!getElementName().equals(this.parent.getElementName())) { // faster than reaching the info return false; } IBinaryMethod info = (IBinaryMethod) getElementInfo(); return info.isConstructor(); } /*
public boolean isConstructor() throws JavaModelException { if (!getElementName().equals(this.parent.getElementName())) { // faster than reaching the info return false; } IBinaryMethod info = (IBinaryMethod) getElementInfo(); return info.isConstructor(); } /*
public boolean isConstructor() throws JavaModelException { if (!getElementName().equals(this.parent.getElementName())) { // faster than reaching the info return false; } IBinaryMethod info = (IBinaryMethod) getElementInfo(); return info.isConstructor(); } /*
public boolean isConstructor() throws JavaModelException { if (!getElementName().equals(this.parent.getElementName())) { // faster than reaching the info return false; } IBinaryMethod info = (IBinaryMethod) getElementInfo(); return info.isConstructor(); } /*
public boolean isConstructor() throws JavaModelException { if (!getElementName().equals(this.parent.getElementName())) { // faster than reaching the info return false; } IBinaryMethod info = (IBinaryMethod) getElementInfo(); return info.isConstructor(); } /*
protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); buffer.append(" (not open)"); //$NON-NLS-1$ } else if (info == NO_INFO) { toStringName(buffer); } else { IBinaryMethod methodInfo = (IBinaryMethod) info; int flags = methodInfo.getModifiers(); if (Flags.isStatic(flags)) { buffer.append("static "); //$NON-NLS-1$ } if (!methodInfo.isConstructor()) { buffer.append(Signature.toString(getReturnType(methodInfo))); buffer.append(' '); } toStringName(buffer, flags); } } protected void toStringName(StringBuffer buffer) {
protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); buffer.append(" (not open)"); //$NON-NLS-1$ } else if (info == NO_INFO) { toStringName(buffer); } else { IBinaryMethod methodInfo = (IBinaryMethod) info; int flags = methodInfo.getModifiers(); if (Flags.isStatic(flags)) { buffer.append("static "); //$NON-NLS-1$ } if (!methodInfo.isConstructor()) { buffer.append(Signature.toString(getReturnType(methodInfo))); buffer.append(' '); } toStringName(buffer, flags); } } protected void toStringName(StringBuffer buffer) {
protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); buffer.append(" (not open)"); //$NON-NLS-1$ } else if (info == NO_INFO) { toStringName(buffer); } else { IBinaryMethod methodInfo = (IBinaryMethod) info; int flags = methodInfo.getModifiers(); if (Flags.isStatic(flags)) { buffer.append("static "); //$NON-NLS-1$ } if (!methodInfo.isConstructor()) { buffer.append(Signature.toString(getReturnType(methodInfo))); buffer.append(' '); } toStringName(buffer, flags); } } protected void toStringName(StringBuffer buffer) {
@Override protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); buffer.append(" (not open)"); //$NON-NLS-1$ } else if (info == NO_INFO) { toStringName(buffer); } else { IBinaryMethod methodInfo = (IBinaryMethod) info; int flags = methodInfo.getModifiers(); if (Flags.isStatic(flags)) { buffer.append("static "); //$NON-NLS-1$ } if (!methodInfo.isConstructor()) { buffer.append(Signature.toString(getReturnType(methodInfo))); buffer.append(' '); } toStringName(buffer, flags); } } @Override
protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); buffer.append(" (not open)"); //$NON-NLS-1$ } else if (info == NO_INFO) { toStringName(buffer); } else { IBinaryMethod methodInfo = (IBinaryMethod) info; int flags = methodInfo.getModifiers(); if (Flags.isStatic(flags)) { buffer.append("static "); //$NON-NLS-1$ } if (!methodInfo.isConstructor()) { buffer.append(Signature.toString(getReturnType(methodInfo))); buffer.append(' '); } toStringName(buffer, flags); } } protected void toStringName(StringBuffer buffer) {
protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); buffer.append(" (not open)"); //$NON-NLS-1$ } else if (info == NO_INFO) { toStringName(buffer); } else { IBinaryMethod methodInfo = (IBinaryMethod) info; int flags = methodInfo.getModifiers(); if (Flags.isStatic(flags)) { buffer.append("static "); //$NON-NLS-1$ } if (!methodInfo.isConstructor()) { buffer.append(Signature.toString(getReturnType(methodInfo))); buffer.append(' '); } toStringName(buffer, flags); } } protected void toStringName(StringBuffer buffer) {
boolean matchConstructor(ConstructorPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) { if (!pattern.findDeclarations) return false; // only relevant when finding declarations if (!(binaryInfo instanceof IBinaryMethod)) return false; IBinaryMethod method = (IBinaryMethod) binaryInfo; if (!method.isConstructor()) return false; if (!checkDeclaringType(enclosingBinaryType, pattern.declaringSimpleName, pattern.declaringQualification, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; if (pattern.parameterSimpleNames != null) { char[] methodDescriptor = convertClassFileFormat(method.getMethodDescriptor()); if (!checkParameters(methodDescriptor, pattern.parameterSimpleNames, pattern.parameterQualifications, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; } return true; } boolean matchField(FieldPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) {
boolean matchConstructor(ConstructorPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) { if (!pattern.findDeclarations) return false; // only relevant when finding declarations if (!(binaryInfo instanceof IBinaryMethod)) return false; IBinaryMethod method = (IBinaryMethod) binaryInfo; if (!method.isConstructor()) return false; if (!checkDeclaringType(enclosingBinaryType, pattern.declaringSimpleName, pattern.declaringQualification, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; if (pattern.parameterSimpleNames != null) { char[] methodDescriptor = convertClassFileFormat(method.getMethodDescriptor()); if (!checkParameters(methodDescriptor, pattern.parameterSimpleNames, pattern.parameterQualifications, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; } return true; } boolean matchField(FieldPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) {
boolean matchConstructor(ConstructorPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) { if (!pattern.findDeclarations) return false; // only relevant when finding declarations if (!(binaryInfo instanceof IBinaryMethod)) return false; IBinaryMethod method = (IBinaryMethod) binaryInfo; if (!method.isConstructor()) return false; if (!checkDeclaringType(enclosingBinaryType, pattern.declaringSimpleName, pattern.declaringQualification, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; if (pattern.parameterSimpleNames != null) { char[] methodDescriptor = convertClassFileFormat(method.getMethodDescriptor()); if (!checkParameters(methodDescriptor, pattern.parameterSimpleNames, pattern.parameterQualifications, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; } return true; } boolean matchField(FieldPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) {
boolean matchConstructor(ConstructorPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) { if (!pattern.findDeclarations) return false; // only relevant when finding declarations if (!(binaryInfo instanceof IBinaryMethod)) return false; IBinaryMethod method = (IBinaryMethod) binaryInfo; if (!method.isConstructor()) return false; if (!checkDeclaringType(enclosingBinaryType, pattern.declaringSimpleName, pattern.declaringQualification, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; if (pattern.parameterSimpleNames != null) { char[] methodDescriptor = convertClassFileFormat(method.getMethodDescriptor()); if (!checkParameters(methodDescriptor, pattern.parameterSimpleNames, pattern.parameterQualifications, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; } return true; } boolean matchField(FieldPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) {
boolean matchConstructor(ConstructorPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) { if (!pattern.findDeclarations) return false; // only relevant when finding declarations if (!(binaryInfo instanceof IBinaryMethod)) return false; IBinaryMethod method = (IBinaryMethod) binaryInfo; if (!method.isConstructor()) return false; if (!checkDeclaringType(enclosingBinaryType, pattern.declaringSimpleName, pattern.declaringQualification, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; if (pattern.parameterSimpleNames != null) { char[] methodDescriptor = convertClassFileFormat(method.getMethodDescriptor()); if (!checkParameters(methodDescriptor, pattern.parameterSimpleNames, pattern.parameterQualifications, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; } return true; } boolean matchField(FieldPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) {
boolean matchConstructor(ConstructorPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) { if (!pattern.findDeclarations) return false; // only relevant when finding declarations if (!(binaryInfo instanceof IBinaryMethod)) return false; IBinaryMethod method = (IBinaryMethod) binaryInfo; if (!method.isConstructor()) return false; if (!checkDeclaringType(enclosingBinaryType, pattern.declaringSimpleName, pattern.declaringQualification, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; if (pattern.parameterSimpleNames != null) { char[] methodDescriptor = convertClassFileFormat(method.getMethodDescriptor()); if (!checkParameters(methodDescriptor, pattern.parameterSimpleNames, pattern.parameterQualifications, pattern.isCaseSensitive(), pattern.isCamelCase())) return false; } return true; } boolean matchField(FieldPattern pattern, Object binaryInfo, IBinaryType enclosingBinaryType) {
@Override public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, Object member, LookupEnvironment environment) { if (walker == ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER && this.annotationProvider != null) { if (member == null) { return this.annotationProvider.forTypeHeader(environment); } else if (member instanceof IBinaryField) { IBinaryField field = (IBinaryField) member; char[] fieldSignature = field.getGenericSignature(); if (fieldSignature == null) fieldSignature = field.getTypeName(); return this.annotationProvider.forField(field.getName(), fieldSignature, environment); } else if (member instanceof IBinaryMethod) { IBinaryMethod method = (IBinaryMethod) member; char[] methodSignature = method.getGenericSignature(); if (methodSignature == null) methodSignature = method.getMethodDescriptor(); return this.annotationProvider.forMethod( method.isConstructor() ? TypeConstants.INIT : method.getSelector(), methodSignature, environment); } } return walker; }
@Override public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, Object member, LookupEnvironment environment) { if (walker == ITypeAnnotationWalker.EMPTY_ANNOTATION_WALKER && this.annotationProvider != null) { if (member == null) { return this.annotationProvider.forTypeHeader(environment); } else if (member instanceof IBinaryField) { IBinaryField field = (IBinaryField) member; char[] fieldSignature = field.getGenericSignature(); if (fieldSignature == null) fieldSignature = field.getTypeName(); return this.annotationProvider.forField(field.getName(), fieldSignature, environment); } else if (member instanceof IBinaryMethod) { IBinaryMethod method = (IBinaryMethod) member; char[] methodSignature = method.getGenericSignature(); if (methodSignature == null) methodSignature = method.getMethodDescriptor(); return this.annotationProvider.forMethod( method.isConstructor() ? TypeConstants.INIT : method.getSelector(), methodSignature, environment); } } return walker; }