boolean isSynthetic(FieldOrMethod obj) { Attribute[] a = obj.getAttributes(); for (Attribute aA : a) { if (aA instanceof Synthetic) { return true; } } return false; }
private static boolean internalIsSynthetic(final FieldOrMethod m) { if (m.isSynthetic()) { return true; } for (final Attribute a : m.getAttributes()) { if (a instanceof Synthetic) { return true; } } return false; }
/** * Checks if the given member is synthetic * * @param m The member to be checked * @return True if the member is synthetic, false otherwise * @deprecated You probably don't care for synthetic members, but want to * know if the developer added it (think of lambdas), use * {@link MemberUtils#isUserGenerated(FieldOrMethod)} instead */ @Deprecated public static boolean isSynthetic(FieldOrMethod m) { if (m.isSynthetic()) { return true; } for(Attribute a : m.getAttributes()) { if (a instanceof Synthetic) { return true; } } return false; } public static boolean isSynthetic(JavaClass j) {
/** * @return Code attribute of method, if any */ public final Code getCode() { for (final Attribute attribute : super.getAttributes()) { if (attribute instanceof Code) { return (Code) attribute; } } return null; }
boolean isSynthetic(FieldOrMethod obj) { Attribute[] a = obj.getAttributes(); for (Attribute aA : a) { if (aA instanceof Synthetic) { return true; } } return false; }
/** * @return ExceptionTable attribute of method, if any, i.e., list all * exceptions the method may throw not exception handlers! */ public final ExceptionTable getExceptionTable() { for (final Attribute attribute : super.getAttributes()) { if (attribute instanceof ExceptionTable) { return (ExceptionTable) attribute; } } return null; }
private Signature getSignature(FieldOrMethod fieldOrMethod) { for (Attribute attribute : fieldOrMethod.getAttributes()) { if (attribute instanceof Signature) { return (Signature) attribute; } } return null; }
/** * @return constant value associated with this field (may be null) */ public final ConstantValue getConstantValue() { for (final Attribute attribute : super.getAttributes()) { if (attribute.getTag() == Const.ATTR_CONSTANT_VALUE) { return (ConstantValue) attribute; } } return null; }
/** * @return Annotations on the field or method * @since 6.0 */ public AnnotationEntry[] getAnnotationEntries() { if (annotationEntries == null) { annotationEntries = AnnotationEntry.createAnnotationEntries(getAttributes()); } return annotationEntries; }
public static boolean isSynthetic(FieldOrMethod m) { if (m.isSynthetic()) { return true; } for(Attribute a : m.getAttributes()) { if (a instanceof Synthetic) { return true; } } return false; } public static boolean isSynthetic(JavaClass j) {
/** * Return string representation close to declaration format, * `public static final short MAX = 100', e.g.. * * @return String representation of field, including the signature. */ @Override public final String toString() { String name; String signature; String access; // Short cuts to constant pool // Get names from constant pool access = Utility.accessToString(super.getAccessFlags()); access = access.isEmpty() ? "" : (access + " "); signature = Utility.signatureToString(getSignature()); name = getName(); final StringBuilder buf = new StringBuilder(64); // CHECKSTYLE IGNORE MagicNumber buf.append(access).append(signature).append(" ").append(name); final ConstantValue cv = getConstantValue(); if (cv != null) { buf.append(" = ").append(cv); } for (final Attribute attribute : super.getAttributes()) { if (!(attribute instanceof ConstantValue)) { buf.append(" [").append(attribute).append("]"); } } return buf.toString(); }
/** * Initialize from another object. Note that both objects use the same * references (shallow copy). Use clone() for a physical copy. */ protected FieldOrMethod(final FieldOrMethod c) { this(c.getAccessFlags(), c.getNameIndex(), c.getSignatureIndex(), c.getAttributes(), c .getConstantPool()); }
/** * Initialize from another object. Note that both objects use the same * references (shallow copy). Use clone() for a physical copy. */ protected FieldOrMethod(FieldOrMethod c) { this(c.getAccessFlags(), c.getNameIndex(), c.getSignatureIndex(), c.getAttributes(), c.getConstantPool()); }
getLocalVariableTable()); final StringBuilder buf = new StringBuilder(signature); for (final Attribute attribute : super.getAttributes()) { if (!((attribute instanceof Code) || (attribute instanceof ExceptionTable))) { buf.append(" [").append(attribute).append("]");