public AnnotationAccessFieldVar(AnnotationAccessVar aav, ResolvedType annoFieldOfInterest, String name) { super(annoFieldOfInterest, 0); this.annoAccessor = aav; this.name = name; String sig = annoFieldOfInterest.getSignature(); if (sig.length() == 1) { switch (sig.charAt(0)) { case 'I': elementValueType = ElementValue.PRIMITIVE_INT; break; default: throw new IllegalStateException(sig); } } else if (sig.equals("Ljava/lang/String;")) { elementValueType = ElementValue.STRING; } else if (annoFieldOfInterest.isEnum()) { elementValueType = ElementValue.ENUM_CONSTANT; } else { throw new IllegalStateException(sig); } this.annoFieldOfInterest = annoFieldOfInterest; }
/** * Match based on given type pattern, only classes can be matched * * @param matchType * @param aspectType * @return true if match */ public boolean matches(ResolvedType matchType, ResolvedType aspectType) { // match only on class if (matchType.isEnum() || matchType.isInterface() || matchType.isAnnotation()) { return false; } return typePattern.matchesStatically(matchType); }
/** * Match based on given type pattern, only classes can be matched * * @param matchType * @param aspectType * @return true if match */ public boolean matches(ResolvedType matchType, ResolvedType aspectType) { // match only on class if (matchType.isEnum() || matchType.isInterface() || matchType.isAnnotation()) { return false; } return typePattern.matchesStatically(matchType); }
/** * @return true if the supplied type is of the category specified for this type pattern */ private boolean isRightCategory(ResolvedType type) { switch (category) { case CLASS: return type.isClass(); case INTERFACE: return type.isInterface(); case ASPECT: return type.isAspect(); case ANONYMOUS: return type.isAnonymous(); case INNER: return type.isNested(); case ENUM: return type.isEnum(); case ANNOTATION: return type.isAnnotation(); case FINAL: return Modifier.isFinal(type.getModifiers()); } return false; }
validKey = true; ResolvedType t = resolvedMember.getReturnType().resolve(scope.getWorld()); if (t.isEnum()) {
if (!(formalBindingType.isEnum() || bindingTypeSignature.equals("Ljava/lang/String;") || bindingTypeSignature.equals("I"))) { scope.message(IMessage.ERROR, this, "The field within the annotation must be an enum, string or int. '" + formalBinding.getType()
private boolean mungeFieldHost(BcelClassWeaver weaver, MethodDelegateTypeMunger.FieldHostTypeMunger munger) { LazyClassGen gen = weaver.getLazyClassGen(); if (gen.getType().isAnnotation() || gen.getType().isEnum()) { // don't signal error as it could be a consequence of a wild type // pattern return false; } // boolean shouldApply = munger.matches(weaver.getLazyClassGen().getType(), aspectType); // why // do // this? ResolvedMember host = AjcMemberMaker.itdAtDeclareParentsField(weaver.getLazyClassGen().getType(), munger.getSignature() .getType(), aspectType); FieldGen field = makeFieldGen(weaver.getLazyClassGen(), host); field.setModifiers(field.getModifiers() | BcelField.AccSynthetic); weaver.getLazyClassGen().addField(field, null); return true; }
if (reportErrors && isWildChild && targetType.isEnum()) { world.getLint().enumAsTargetForDecpIgnored.signal(targetType.toString(), getSourceLocation()); if (targetType.isEnum() && parentType.isInterface()) { if (reportErrors && !isWildChild) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.CANT_DECP_ON_ENUM_TO_IMPL_INTERFACE, if (targetType.isEnum() && parentType.isClass()) { if (reportErrors && !isWildChild) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.CANT_DECP_ON_ENUM_TO_EXTEND_CLASS,
if (onType.isEnum()) { signalError(WeaverMessages.ITDF_ON_ENUM_NOT_ALLOWED, weaver, onType); return false;
if (onType.isEnum()) { signalError(WeaverMessages.ITDC_ON_ENUM_NOT_ALLOWED, weaver, onType); return false;
if (onType.isEnum()) { signalError(WeaverMessages.ITDM_ON_ENUM_NOT_ALLOWED, classWeaver, onType); return false;
if (gen.getType().isAnnotation() || gen.getType().isEnum()) {