private void addDecoratorDef(Method method) { Decorate annotation = method.getAnnotation(Decorate.class); Class serviceInterface = annotation == null ? null : annotation.serviceInterface(); // TODO: methods just named "decorate" String decoratorId = annotation == null ? stripMethodPrefix(method, DECORATE_METHOD_NAME_PREFIX) : extractId( serviceInterface, annotation.id()); // TODO: Check for duplicates Class returnType = method.getReturnType(); if (returnType.isPrimitive() || returnType.isArray()) { throw new RuntimeException(String.format( "Method %s is named like a service decorator method, but the return type (%s) is not acceptable (try Object).", InternalUtils.asString(method), method.getReturnType().getCanonicalName())); } Set<Class> markers = extractMarkers(method, Decorate.class); DecoratorDef def = new DecoratorDefImpl(method, extractPatterns(decoratorId, method), extractConstraints(method), proxyFactory, decoratorId, serviceInterface, markers); decoratorDefs.put(decoratorId, def); }
private void addDecoratorDef(Method method) { Decorate annotation = method.getAnnotation(Decorate.class); Class serviceInterface = annotation == null ? null : annotation.serviceInterface(); // TODO: methods just named "decorate" String decoratorId = annotation == null ? stripMethodPrefix(method, DECORATE_METHOD_NAME_PREFIX) : extractId( serviceInterface, annotation.id()); // TODO: Check for duplicates Class returnType = method.getReturnType(); if (returnType.isPrimitive() || returnType.isArray()) { throw new RuntimeException(String.format( "Method %s is named like a service decorator method, but the return type (%s) is not acceptable (try Object).", InternalUtils.asString(method), method.getReturnType().getCanonicalName())); } Set<Class> markers = extractMarkers(method, Decorate.class); DecoratorDef def = new DecoratorDefImpl(method, extractPatterns(decoratorId, method), extractConstraints(method), proxyFactory, decoratorId, serviceInterface, markers); decoratorDefs.put(decoratorId, def); }