use of com.taobao.android.dx.cf.attrib.AttSourceFile in project atlas by alibaba.
the class StdAttributeFactory method sourceFile.
/**
* Parses a {@code SourceFile} attribute.
*/
private Attribute sourceFile(DirectClassFile cf, int offset, int length, ParseObserver observer) {
if (length != 2) {
throwBadLength(2);
}
ByteArray bytes = cf.getBytes();
ConstantPool pool = cf.getConstantPool();
int idx = bytes.getUnsignedShort(offset);
CstString cst = (CstString) pool.get(idx);
Attribute result = new AttSourceFile(cst);
if (observer != null) {
observer.parsed(bytes, offset, 2, "source: " + cst);
}
return result;
}
use of com.taobao.android.dx.cf.attrib.AttSourceFile in project atlas by alibaba.
the class DirectClassFile method getSourceFile.
/** {@inheritDoc} */
public CstString getSourceFile() {
AttributeList attribs = getAttributes();
Attribute attSf = attribs.findFirst(AttSourceFile.ATTRIBUTE_NAME);
if (attSf instanceof AttSourceFile) {
return ((AttSourceFile) attSf).getSourceFile();
}
return null;
}
Aggregations