/** * @private Debugging purposes */ 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 { try { buffer.append(Signature.toString(getTypeSignature())); buffer.append(" "); //$NON-NLS-1$ toStringName(buffer); } catch (JavaModelException e) { buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$ } } } }
/** * @see IType#getField */ @Override public IField getField(String fieldName) { return new SourceField(this, fieldName); } /**
public String getKey() { try { return getKey(this, false/*don't open*/); } catch (JavaModelException e) { // happen only if force open is true return null; } } /**
private FieldDeclaration convert(SourceField fieldHandle, TypeDeclaration type, CompilationResult compilationResult) throws JavaModelException { SourceFieldElementInfo fieldInfo = (SourceFieldElementInfo) fieldHandle.getElementInfo(); FieldDeclaration field = new FieldDeclaration(); int end = fieldInfo.getNameSourceEnd(); field.name = fieldHandle.getElementName().toCharArray(); field.sourceStart = start; field.sourceEnd = end;
/** * @see IField */ @Override public String getTypeSignature() throws JavaModelException { SourceFieldElementInfo info = (SourceFieldElementInfo) getElementInfo(); return info.getTypeSignature(); }
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent =this.parent.getPrimaryElement(false); return ((IType)primaryParent).getField(this.name); } /**
/** * @private Debugging purposes */ @Override protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ buffer.append(this.getKey()); buffer.append("}"); //$NON-NLS-1$ } }
*/public boolean isEnumConstant() throws JavaModelException { return Flags.isEnum(getFlags()); } /* (non-Javadoc)
private FieldDeclaration convert(SourceField fieldHandle, TypeDeclaration type, CompilationResult compilationResult) throws JavaModelException { SourceFieldElementInfo fieldInfo = (SourceFieldElementInfo) fieldHandle.getElementInfo(); FieldDeclaration field = new FieldDeclaration(); int end = fieldInfo.getNameSourceEnd(); field.name = fieldHandle.getElementName().toCharArray(); field.sourceStart = start; field.sourceEnd = end;
/** * @see IField */ public String getTypeSignature() throws JavaModelException { SourceFieldElementInfo info = (SourceFieldElementInfo) getElementInfo(); return info.getTypeSignature(); } /* (non-Javadoc)
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent =this.parent.getPrimaryElement(false); return ((IType)primaryParent).getField(this.name); } /**
/** * @private Debugging purposes */ protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ buffer.append(this.getKey()); buffer.append("}"); //$NON-NLS-1$ } }
@Override public boolean isEnumConstant() throws JavaModelException { return Flags.isEnum(getFlags()); }
/** * @private Debugging purposes */ 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 { try { buffer.append(Signature.toString(getTypeSignature())); buffer.append(" "); //$NON-NLS-1$ toStringName(buffer); } catch (JavaModelException e) { buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$ } } } }
private FieldDeclaration convert(SourceField fieldHandle, TypeDeclaration type, CompilationResult compilationResult) throws JavaModelException { SourceFieldElementInfo fieldInfo = (SourceFieldElementInfo) fieldHandle.getElementInfo(); FieldDeclaration field = new FieldDeclaration(); int end = fieldInfo.getNameSourceEnd(); field.name = fieldHandle.getElementName().toCharArray(); field.sourceStart = start; field.sourceEnd = end;
/** * @see IField */ public String getTypeSignature() throws JavaModelException { SourceFieldElementInfo info = (SourceFieldElementInfo) getElementInfo(); return info.getTypeSignature(); } /* (non-Javadoc)
@Override public JavaElement unresolved() { SourceRefElement handle = new SourceField(this.parent, this.name); handle.occurrenceCount = this.occurrenceCount; return handle; } }
public String getKey() { try { return getKey(this, false/*don't open*/); } catch (JavaModelException e) { // happen only if force open is true return null; } } /**
@Override public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent =this.parent.getPrimaryElement(false); return ((IType)primaryParent).getField(this.name); } /**
/** * @private Debugging purposes */ protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ buffer.append(this.getKey()); buffer.append("}"); //$NON-NLS-1$ } }