<s> package org . eclipse . jdt . internal . core ; import org . eclipse . core . runtime . IProgressMonitor ; import org . eclipse . jdt . core . Flags ; import org . eclipse . jdt . core . IAnnotation ; import org . eclipse . jdt . core . IField ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . env . IBinaryField ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; class BinaryField extends BinaryMember implements IField { protected BinaryField ( JavaElement parent , String name ) { super ( parent , name ) ; } public boolean equals ( Object o ) { if ( ! ( o instanceof BinaryField ) ) return false ; return super . equals ( o ) ; } public IAnnotation [ ] getAnnotations ( ) throws JavaModelException { IBinaryField info = ( IBinaryField ) getElementInfo ( ) ; IBinaryAnnotation [ ] binaryAnnotations = info . getAnnotations ( ) ; return getAnnotations ( binaryAnnotations , info . getTagBits ( ) ) ; } public Object getConstant ( ) throws JavaModelException { IBinaryField info = ( IBinaryField ) getElementInfo ( ) ; return convertConstant ( info . getConstant ( ) ) ; } public int getFlags ( ) throws JavaModelException { IBinaryField info = ( IBinaryField ) getElementInfo ( ) ; return info . getModifiers ( ) ; } public int getElementType ( ) { return FIELD ; } protected char getHandleMementoDelimiter ( ) { return JavaElement . JEM_FIELD ; } public String getKey ( boolean forceOpen ) throws JavaModelException { return getKey ( this , forceOpen ) ; } public String getTypeSignature ( ) throws JavaModelException { IBinaryField info = ( IBinaryField ) getElementInfo ( ) ; char [ ] genericSignature = info . getGenericSignature ( ) ; if ( genericSignature != null ) { return new String ( ClassFile . translatedName ( genericSignature ) ) ; } return new String ( ClassFile . translatedName ( info . getTypeName ( ) ) ) ; } public boolean isEnumConstant ( ) throws JavaModelException { return Flags . isEnum ( getFlags ( ) ) ; } public boolean isResolved ( ) { return false ; } public JavaElement resolved ( Binding binding ) { SourceRefElement resolvedHandle = new ResolvedBinaryField ( this . parent , this . name , new String ( binding . computeUniqueKey ( ) ) ) ; resolvedHandle . occurrenceCount = this . occurrenceCount ; return resolvedHandle ; } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { buffer . append ( tabString ( tab ) ) ; if ( info == null ) { toStringName ( buffer ) ; buffer . append ( " (not open)" ) ; } else if ( info == NO_INFO ) { toStringName ( buffer ) ; } else { try { buffer . append ( Signature . toString ( getTypeSignature ( ) ) ) ; buffer . append ( " " ) ; toStringName ( buffer ) ; } catch ( JavaModelException e ) { buffer . append ( "" + getElementName ( ) ) ; } } } public String getAttachedJavadoc ( IProgressMonitor monitor ) throws JavaModelException { JavadocContents javadocContents = ( ( BinaryType ) this . getDeclaringType ( ) ) . getJavadocContents ( monitor ) ; if ( javadocContents == null ) return null ; return javadocContents . getFieldDoc ( this ) ; } } </s>