Source:
private void parseClass() { if (!algorithmClass.isAnnotationPresent(Algorithm.class)) { throw new RuntimeException("Class isn't annotated with an Algorithm annotation"); } boolean validContructor = false; try { Constructor defaultConstructor = algorithmClass.getConstructor(new Class[0]); validContructor = (defaultConstructor.getModifiers() & Modifier.PUBLIC) == Modifier.PUBLIC; } catch (NoSuchMethodException ex) { } catch (SecurityException ex) { throw new RuntimeException("Current security policy limits use of reflection, error introspecting " + algorithmClass.getName()); } if (!validContructor) { throw new RuntimeException("Classes with Algorithm annotation require public no-arg constructor, error introspecting " + algorithmClass.getName()); } AlgorithmDescriptor.Builder<?> algorithmBuilder = null; Algorithm algorithm = algorithmClass.getAnnotation(Algorithm.class); algorithmBuilder = AlgorithmDescriptor.builder( algorithm.identifier().length() > 0 ? algorithm.identifier() : algorithmClass.getCanonicalName()); algorithmBuilder. title(algorithm.title()). abstrakt(algorithm.abstrakt()). version(algorithm.version()). storeSupported(algorithm.storeSupported()). statusSupported(algorithm.statusSupported()); parseElements(algorithmClass.getDeclaredMethods(), INPUT_METHOD_PARSERS, OUTPUT_METHOD_PARSERS); parseElements(algorithmClass.getDeclaredFields(), INPUT_FIELD_PARSERS, OUTPUT_FIELD_PARSERS); for (Method method : algorithmClass.getDeclaredMethods()) { if (method.isAnnotationPresent(PROCESS_PARSER.getSupportedAnnotation())) { ExecuteMethodBinding executeMethodBinding = PROCESS_PARSER.parse(method); if (executeMethodBinding != null) { if (this.executeMethodBinding != null) { throw new RuntimeException("Multiple execute method bindings encountered for class " + getClass().getCanonicalName()); } this.executeMethodBinding = executeMethodBinding; } } } if(this.executeMethodBinding == null) { throw new RuntimeException("No execute method binding for class " + getClass().getCanonicalName()); } for (InputBinding<?,?> inputBinding : inputBindingMap.values()) { algorithmBuilder.addInputDescriptor(inputBinding.getDescriptor()); } for (OutputBinding<?,?> outputBinding : outputBindingMap.values()) { algorithmBuilder.addOutputDescriptor(outputBinding.getDescriptor()); } algorithmDescriptor = algorithmBuilder.build(); }

Target:
private void parseClass() { if (!algorithmClass.isAnnotationPresent(Algorithm.class)) { throw new RuntimeException("Class isn't annotated with an Algorithm annotation"); } boolean validContructor = false; try { Constructor defaultConstructor = algorithmClass.getConstructor(new Class[0]); validContructor = (defaultConstructor.getModifiers() & Modifier.PUBLIC) == Modifier.PUBLIC; } catch (NoSuchMethodException ex) { } catch (SecurityException ex) { throw new RuntimeException("Current security policy limits use of reflection, error introspecting " + algorithmClass.getName()); } if (!validContructor) { throw new RuntimeException("Classes with Algorithm annotation require public no-arg constructor, error introspecting " + algorithmClass.getName()); } AlgorithmDescriptor.Builder<?> algorithmBuilder = null; Algorithm algorithm = algorithmClass.getAnnotation(Algorithm.class); algorithmBuilder = AlgorithmDescriptor.builder( algorithm.identifier().length() > 0 ? algorithm.identifier() : algorithmClass.getCanonicalName()); algorithmBuilder. title(algorithm.title()). abstrakt(algorithm.abstrakt()). version(algorithm.version()). storeSupported(algorithm.storeSupported()). statusSupported(algorithm.statusSupported()); parseElements(algorithmClass.getDeclaredMethods(), INPUT_METHOD_PARSERS, OUTPUT_METHOD_PARSERS); parseElements(algorithmClass.getDeclaredFields(), INPUT_FIELD_PARSERS, OUTPUT_FIELD_PARSERS); for (Method method : algorithmClass.getDeclaredMethods()) { if (method.isAnnotationPresent(PROCESS_PARSER.getSupportedAnnotation())) { ExecuteMethodBinding executeMethodBinding = PROCESS_PARSER.parse(method); if (executeMethodBinding != null) { if (this.executeMethodBinding != null) { throw new RuntimeException("Multiple execute method bindings encountered for class " + getClass().getCanonicalName()); } this.executeMethodBinding = executeMethodBinding; } } } if(this.executeMethodBinding == null) { throw new RuntimeException("No execute method binding for class " + this.algorithmClass.getCanonicalName()); } for (InputBinding<?,?> inputBinding : inputBindingMap.values()) { algorithmBuilder.addInputDescriptor(inputBinding.getDescriptor()); } for (OutputBinding<?,?> outputBinding : outputBindingMap.values()) { algorithmBuilder.addOutputDescriptor(outputBinding.getDescriptor()); } algorithmDescriptor = algorithmBuilder.build(); }