/** * Constructs a standard {@code Throws} annotation. * * @param types {@code non-null;} the list of thrown types * @return {@code non-null;} the annotation */ public static Annotation makeThrows(TypeList types) { CstArray array = makeCstArray(types); Annotation result = new Annotation(THROWS_TYPE, SYSTEM); result.put(new NameValuePair(VALUE_STRING, array)); result.setImmutable(); return result; }
return AnnotationUtils.makeEnclosingClass(enclosingClass); return AnnotationUtils.makeEnclosingMethod( new CstMethodRef(enclosingClass, nat));
/** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate */ private static Annotation getSignature(AttributeList attribs) { AttSignature signature = (AttSignature) attribs.findFirst(AttSignature.ATTRIBUTE_NAME); if (signature == null) { return null; } return AnnotationUtils.makeSignature(signature.getSignature()); }
result.add(AnnotationUtils.makeInnerClass( foundThisClass.getInnerName(), foundThisClass.getAccessFlags())); "compiler.)"); result.add(AnnotationUtils.makeEnclosingClass( foundThisClass.getOuterClass())); result.add(AnnotationUtils.makeMemberClasses(typeList));
/** * Gets the annotations out of a given method, similar to {@link * #getAnnotations}, also including an annotation for the translation * of the method-specific attribute {@code Exceptions}. * * @param method {@code non-null;} the method in question * @return {@code non-null;} the set of annotations, which may be empty */ public static Annotations getMethodAnnotations(Method method) { Annotations result = getAnnotations(method.getAttributes()); TypeList exceptions = getExceptions(method); if (exceptions.size() != 0) { Annotation throwsAnnotation = AnnotationUtils.makeThrows(exceptions); result = Annotations.combine(result, throwsAnnotation); } return result; }
return AnnotationUtils.makeAnnotationDefault(result);
result.add(AnnotationUtils.makeInnerClass( foundThisClass.getInnerName(), foundThisClass.getAccessFlags())); "indicate that it is *not* an inner class."); result.add(AnnotationUtils.makeEnclosingClass( foundThisClass.getOuterClass())); result.add(AnnotationUtils.makeMemberClasses(typeList));
/** * Gets the annotations out of a given method, similar to {@link * #getAnnotations}, also including an annotation for the translation * of the method-specific attribute {@code Exceptions}. * * @param method {@code non-null;} the method in question * @return {@code non-null;} the set of annotations, which may be empty */ public static Annotations getMethodAnnotations(Method method) { Annotations result = getAnnotations(method.getAttributes()); TypeList exceptions = getExceptions(method); if (exceptions.size() != 0) { Annotation throwsAnnotation = AnnotationUtils.makeThrows(exceptions); result = Annotations.combine(result, throwsAnnotation); } return result; }
return AnnotationUtils.makeAnnotationDefault(result);
result.add(AnnotationUtils.makeInnerClass( foundThisClass.getInnerName(), foundThisClass.getAccessFlags())); "indicate that it is *not* an inner class."); result.add(AnnotationUtils.makeEnclosingClass( foundThisClass.getOuterClass())); result.add(AnnotationUtils.makeMemberClasses(typeList));
/** * Constructs a standard {@code MemberClasses} annotation. * * @param types {@code non-null;} the list of (the types of) the member classes * @return {@code non-null;} the annotation */ public static Annotation makeMemberClasses(TypeList types) { CstArray array = makeCstArray(types); Annotation result = new Annotation(MEMBER_CLASSES_TYPE, SYSTEM); result.put(new NameValuePair(VALUE_STRING, array)); result.setImmutable(); return result; }
return AnnotationUtils.makeEnclosingClass(enclosingClass); return AnnotationUtils.makeEnclosingMethod( new CstMethodRef(enclosingClass, nat));
/** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate */ private static Annotation getSignature(AttributeList attribs) { AttSignature signature = (AttSignature) attribs.findFirst(AttSignature.ATTRIBUTE_NAME); if (signature == null) { return null; } return AnnotationUtils.makeSignature(signature.getSignature()); }
/** * Gets the annotations out of a given method, similar to {@link * #getAnnotations}, also including an annotation for the translation * of the method-specific attribute {@code Exceptions}. * * @param method {@code non-null;} the method in question * @return {@code non-null;} the set of annotations, which may be empty */ public static Annotations getMethodAnnotations(Method method) { Annotations result = getAnnotations(method.getAttributes()); TypeList exceptions = getExceptions(method); if (exceptions.size() != 0) { Annotation throwsAnnotation = AnnotationUtils.makeThrows(exceptions); result = Annotations.combine(result, throwsAnnotation); } return result; }
return AnnotationUtils.makeAnnotationDefault(result);
result.add(AnnotationUtils.makeInnerClass( foundThisClass.getInnerName(), foundThisClass.getAccessFlags())); "indicate that it is *not* an inner class."); result.add(AnnotationUtils.makeEnclosingClass( foundThisClass.getOuterClass())); result.add(AnnotationUtils.makeMemberClasses(typeList));
/** * Constructs a standard {@code Throws} annotation. * * @param types {@code non-null;} the list of thrown types * @return {@code non-null;} the annotation */ public static Annotation makeThrows(TypeList types) { CstArray array = makeCstArray(types); Annotation result = new Annotation(THROWS_TYPE, SYSTEM); result.put(new NameValuePair(VALUE_STRING, array)); result.setImmutable(); return result; }
return AnnotationUtils.makeEnclosingClass(enclosingClass); return AnnotationUtils.makeEnclosingMethod( new CstMethodRef(enclosingClass, nat));
/** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate */ private static Annotation getSignature(AttributeList attribs) { AttSignature signature = (AttSignature) attribs.findFirst(AttSignature.ATTRIBUTE_NAME); if (signature == null) { return null; } return AnnotationUtils.makeSignature(signature.getSignature()); }
/** * Gets the annotations out of a given method, similar to {@link * #getAnnotations}, also including an annotation for the translation * of the method-specific attribute {@code Exceptions}. * * @param method {@code non-null;} the method in question * @return {@code non-null;} the set of annotations, which may be empty */ public static Annotations getMethodAnnotations(Method method) { Annotations result = getAnnotations(method.getAttributes()); TypeList exceptions = getExceptions(method); if (exceptions.size() != 0) { Annotation throwsAnnotation = AnnotationUtils.makeThrows(exceptions); result = Annotations.combine(result, throwsAnnotation); } return result; }