Java源码示例:com.android.dx.cf.iface.FieldList
示例1
private void addDependencies(DirectClassFile classFile) {
for (Constant constant : classFile.getConstantPool().getEntries()) {
if (constant instanceof CstType) {
checkDescriptor(((CstType) constant).getClassType().getDescriptor());
} else if (constant instanceof CstFieldRef) {
checkDescriptor(((CstFieldRef) constant).getType().getDescriptor());
} else if (constant instanceof CstBaseMethodRef) {
checkPrototype(((CstBaseMethodRef) constant).getPrototype());
}
}
FieldList fields = classFile.getFields();
int nbField = fields.size();
for (int i = 0; i < nbField; i++) {
checkDescriptor(fields.get(i).getDescriptor().getString());
}
MethodList methods = classFile.getMethods();
int nbMethods = methods.size();
for (int i = 0; i < nbMethods; i++) {
checkPrototype(Prototype.intern(methods.get(i).getDescriptor().getString()));
}
}
示例2
private void addDependencies(DirectClassFile classFile) {
for (Constant constant : classFile.getConstantPool().getEntries()) {
if (constant instanceof CstType) {
checkDescriptor(((CstType) constant).getClassType().getDescriptor());
} else if (constant instanceof CstFieldRef) {
checkDescriptor(((CstFieldRef) constant).getType().getDescriptor());
} else if (constant instanceof CstBaseMethodRef) {
checkPrototype(((CstBaseMethodRef) constant).getPrototype());
}
}
FieldList fields = classFile.getFields();
int nbField = fields.size();
for (int i = 0; i < nbField; i++) {
checkDescriptor(fields.get(i).getDescriptor().getString());
}
MethodList methods = classFile.getMethods();
int nbMethods = methods.size();
for (int i = 0; i < nbMethods; i++) {
checkPrototype(Prototype.intern(methods.get(i).getDescriptor().getString()));
}
}
示例3
private void addDependencies(DirectClassFile classFile) {
for (Constant constant : classFile.getConstantPool().getEntries()) {
if (constant instanceof CstType) {
checkDescriptor(((CstType) constant).getClassType().getDescriptor());
} else if (constant instanceof CstFieldRef) {
checkDescriptor(((CstFieldRef) constant).getType().getDescriptor());
} else if (constant instanceof CstBaseMethodRef) {
checkPrototype(((CstBaseMethodRef) constant).getPrototype());
}
}
FieldList fields = classFile.getFields();
int nbField = fields.size();
for (int i = 0; i < nbField; i++) {
checkDescriptor(fields.get(i).getDescriptor().getString());
}
MethodList methods = classFile.getMethods();
int nbMethods = methods.size();
for (int i = 0; i < nbMethods; i++) {
checkPrototype(Prototype.intern(methods.get(i).getDescriptor().getString()));
}
}
示例4
/**
* Keep classes annotated with runtime annotations.
*/
private void keepAnnotated(Path path) throws FileNotFoundException {
for (ClassPathElement element : path.getElements()) {
forClazz:
for (String name : element.list()) {
if (name.endsWith(CLASS_EXTENSION)) {
DirectClassFile clazz = path.getClass(name);
if (hasRuntimeVisibleAnnotation(clazz)) {
filesToKeep.add(name);
} else {
MethodList methods = clazz.getMethods();
for (int i = 0; i<methods.size(); i++) {
if (hasRuntimeVisibleAnnotation(methods.get(i))) {
filesToKeep.add(name);
continue forClazz;
}
}
FieldList fields = clazz.getFields();
for (int i = 0; i<fields.size(); i++) {
if (hasRuntimeVisibleAnnotation(fields.get(i))) {
filesToKeep.add(name);
continue forClazz;
}
}
}
}
}
}
}
示例5
/**
* Keep classes annotated with runtime annotations.
*/
private void keepAnnotated(Path path) throws FileNotFoundException {
for (ClassPathElement element : path.getElements()) {
forClazz:
for (String name : element.list()) {
if (name.endsWith(CLASS_EXTENSION)) {
DirectClassFile clazz = path.getClass(name);
if (hasRuntimeVisibleAnnotation(clazz)) {
filesToKeep.add(name);
} else {
MethodList methods = clazz.getMethods();
for (int i = 0; i<methods.size(); i++) {
if (hasRuntimeVisibleAnnotation(methods.get(i))) {
filesToKeep.add(name);
continue forClazz;
}
}
FieldList fields = clazz.getFields();
for (int i = 0; i<fields.size(); i++) {
if (hasRuntimeVisibleAnnotation(fields.get(i))) {
filesToKeep.add(name);
continue forClazz;
}
}
}
}
}
}
}
示例6
/**
* Keep classes annotated with runtime annotations.
*/
private void keepAnnotated(Path path) throws FileNotFoundException {
for (ClassPathElement element : path.getElements()) {
forClazz:
for (String name : element.list()) {
if (name.endsWith(CLASS_EXTENSION)) {
DirectClassFile clazz = path.getClass(name);
if (hasRuntimeVisibleAnnotation(clazz)) {
filesToKeep.add(name);
} else {
MethodList methods = clazz.getMethods();
for (int i = 0; i<methods.size(); i++) {
if (hasRuntimeVisibleAnnotation(methods.get(i))) {
filesToKeep.add(name);
continue forClazz;
}
}
FieldList fields = clazz.getFields();
for (int i = 0; i<fields.size(); i++) {
if (hasRuntimeVisibleAnnotation(fields.get(i))) {
filesToKeep.add(name);
continue forClazz;
}
}
}
}
}
}
}
示例7
/**
* Keep classes annotated with runtime annotations.
*/
private void keepAnnotated(Path path) throws FileNotFoundException {
for (ClassPathElement element : path.getElements()) {
forClazz:
for (String name : element.list()) {
if (name.endsWith(CLASS_EXTENSION)) {
DirectClassFile clazz = path.getClass(name);
if (hasRuntimeVisibleAnnotation(clazz)) {
filesToKeep.add(name);
} else {
MethodList methods = clazz.getMethods();
for (int i = 0; i<methods.size(); i++) {
if (hasRuntimeVisibleAnnotation(methods.get(i))) {
filesToKeep.add(name);
continue forClazz;
}
}
FieldList fields = clazz.getFields();
for (int i = 0; i<fields.size(); i++) {
if (hasRuntimeVisibleAnnotation(fields.get(i))) {
filesToKeep.add(name);
continue forClazz;
}
}
}
}
}
}
}
示例8
/** {@inheritDoc} */
@Override
public FieldList getFields() {
parseToEndIfNecessary();
return fields;
}
示例9
/** {@inheritDoc} */
@Override
public FieldList getFields() {
parseToEndIfNecessary();
return fields;
}
示例10
/** {@inheritDoc} */
@Override
public FieldList getFields() {
parseToEndIfNecessary();
return fields;
}
示例11
/** {@inheritDoc} */
public FieldList getFields() {
parseToEndIfNecessary();
return fields;
}