Usages of

com.ibm.wala.types.TypeName.findOrCreate(?)
/** * Returns the Element the type matches exactly the given type. * * @return The Element if found or AndroidComponent.UNKNOWN if not */ public static AndroidComponent explicit(String type) { if (!(type.startsWith("L") || type.contains("/"))) { type = StringStuff.deployment2CanonicalTypeString(type); } return explicit(TypeName.findOrCreate(type)); }
static TypeName getTypeName(TypeIdItem fieldType) { ImmutableByteArray fieldTypeArray = ImmutableByteArray.make(fieldType.getTypeDescriptor()); TypeName T = null; if (fieldTypeArray.get(fieldTypeArray.length() - 1) == ';') { T = TypeName.findOrCreate(fieldTypeArray, 0, fieldTypeArray.length() - 1); } else { T = TypeName.findOrCreate(fieldTypeArray); } return T; }
static TypeName getTypeName(String fieldType) { ImmutableByteArray fieldTypeArray = ImmutableByteArray.make(fieldType); TypeName T = null; if (fieldTypeArray.get(fieldTypeArray.length() - 1) == ';') { T = TypeName.findOrCreate(fieldTypeArray, 0, fieldTypeArray.length() - 1); } else { T = TypeName.findOrCreate(fieldTypeArray); } return T; }
private void computeSuperclass() { superclassComputed = true; if (superName == null) { if (!getReference().equals(loader.getLanguage().getRootType())) { superClass = loader.lookupClass(loader.getLanguage().getRootType().getName()); } return; } superClass = loader.lookupClass(TypeName.findOrCreate(superName)); }
/** * initialize the TypeReference field for this instance * * @throws InvalidClassFileException * iff Shrike can't read this class */ private void computeTypeReference() throws InvalidClassFileException { String className = "L" + reader.get().getName(); ImmutableByteArray name = ImmutableByteArray.make(className); typeReference = TypeReference.findOrCreate(getClassLoader().getReference(), TypeName.findOrCreate(name)); }
/** * initialize the TypeReference field for this instance * * @throws InvalidClassFileException iff Shrike can't read this class */ private void computeTypeReference() throws InvalidClassFileException { String className = "L" + reader.get().getName(); ImmutableByteArray name = ImmutableByteArray.make(className); typeReference = TypeReference.findOrCreate(getClassLoader().getReference(), TypeName.findOrCreate(name)); }
public TypeName TypeName(final String name) throws StringUnpackException { try { final TypeName ret = TypeName.findOrCreate(name); if (ret == null) { throw new StringUnpackException(name, TypeName.class, "Got back null."); } else { return ret; } } catch (Exception e) { throw new StringUnpackException(name, TypeName.class, e); } }
protected void addFieldToList(List<FieldImpl> L, Atom name, ImmutableByteArray fieldType, int accessFlags, Collection<Annotation> annotations, TypeSignature sig) { TypeName T = null; if (fieldType.get(fieldType.length() - 1) == ';') { T = TypeName.findOrCreate(fieldType, 0, fieldType.length() - 1); } else { T = TypeName.findOrCreate(fieldType); } TypeReference type = TypeReference.findOrCreate(getClassLoader().getReference(), T); FieldReference fr = FieldReference.findOrCreate(getReference(), name, type); FieldImpl f = new FieldImpl(this, fr, accessFlags, annotations, sig); L.add(f); }
protected void addFieldToList(List<FieldImpl> L, Atom name, ImmutableByteArray fieldType, int accessFlags, Collection<Annotation> annotations, Collection<TypeAnnotation> typeAnnotations, TypeSignature sig) { TypeName T = null; if (fieldType.get(fieldType.length() - 1) == ';') { T = TypeName.findOrCreate(fieldType, 0, fieldType.length() - 1); } else { T = TypeName.findOrCreate(fieldType); } TypeReference type = TypeReference.findOrCreate(getClassLoader().getReference(), T); FieldReference fr = FieldReference.findOrCreate(getReference(), name, type); FieldImpl f = new FieldImpl(this, fr, accessFlags, annotations, typeAnnotations, sig); L.add(f); }
Collection<IField> lookupFields(IClassLoader cl) { Collection<IField> matching = new LinkedList<IField>(); IClass c = cl.lookupClass(TypeName.findOrCreate(className)); if(c == null) return matching; Atom atom = Atom.findOrCreateUnicodeAtom(memberName); Collection<IField> allFields = c.getAllFields(); for(IField f: allFields) { if(f.getName().equals(atom)) { matching.add(f); } } return matching; }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes