本文整理汇总了Java中org.eclipse.jdt.internal.compiler.classfmt.FieldInfo类的典型用法代码示例。如果您正苦于以下问题:Java FieldInfo类的具体用法?Java FieldInfo怎么用?Java FieldInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FieldInfo类属于org.eclipse.jdt.internal.compiler.classfmt包,在下文中一共展示了FieldInfo类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateField
import org.eclipse.jdt.internal.compiler.classfmt.FieldInfo; //导入依赖的package包/类
private void updateField(FieldInfo fieldInfo) {
// generic signature
updateChars(fieldInfo.getGenericSignature());
updateInt(fieldInfo.getModifiers());
updateLong(fieldInfo.getTagBits() & TagBits.AnnotationDeprecated);
updateAnnotations(fieldInfo.getAnnotations());
updateTypeAnnotations(fieldInfo.getTypeAnnotations());
updateChars(fieldInfo.getName());
updateChars(fieldInfo.getTypeName());
updateBoolean(fieldInfo.hasConstant());
if (fieldInfo.hasConstant()) {
updateConstant(fieldInfo.getConstant());
}
}
示例2: digest
import org.eclipse.jdt.internal.compiler.classfmt.FieldInfo; //导入依赖的package包/类
public byte[] digest(IBinaryType classFile) {
// type level comparison
// modifiers
updateInt(classFile.getModifiers());
// only consider a portion of the tagbits which indicate a structural change for dependents
// e.g. @Override change has no influence outside
long OnlyStructuralTagBits = TagBits.AnnotationTargetMASK // different @Target status ?
| TagBits.AnnotationDeprecated // different @Deprecated status ?
| TagBits.AnnotationRetentionMASK // different @Retention status ?
| TagBits.HierarchyHasProblems; // different hierarchy status ?
// meta-annotations
updateLong(classFile.getTagBits() & OnlyStructuralTagBits);
// annotations
updateAnnotations(classFile.getAnnotations());
updateTypeAnnotations(classFile.getTypeAnnotations());
// generic signature
updateChars(classFile.getGenericSignature());
// superclass
updateChars(classFile.getSuperclassName());
// interfaces
char[][] interfacesNames = classFile.getInterfaceNames();
if (interfacesNames != null) {
for (int i = 0; i < interfacesNames.length; i++) {
updateChars(interfacesNames[i]);
}
}
// member types
IBinaryNestedType[] memberTypes = classFile.getMemberTypes();
if (memberTypes != null) {
for (int i = 0; i < memberTypes.length; i++) {
updateChars(memberTypes[i].getName());
updateInt(memberTypes[i].getModifiers());
}
}
// fields
FieldInfo[] fieldInfos = (FieldInfo[]) classFile.getFields();
if (fieldInfos != null) {
for (int i = 0; i < fieldInfos.length; i++) {
updateField(fieldInfos[i]);
}
}
// methods
MethodInfo[] methodInfos = (MethodInfo[]) classFile.getMethods();
if (methodInfos != null) {
for (int i = 0; i < methodInfos.length; i++) {
updateMethod(classFile, methodInfos[i]);
}
}
// missing types
char[][][] missingTypes = classFile.getMissingTypeNames();
if (missingTypes != null) {
for (int i = 0; i < missingTypes.length; i++) {
for (int j = 0; j < missingTypes[i].length; j++) {
if (j > 0) {
updateChar('.'); // don't ask why
}
updateChars(missingTypes[i][j]);
}
}
}
return digester.digest();
}