public static <T> Set<Class<?>> getDefinitions(final T definitionSet) { Set<Class<?>> result = null; if (null != definitionSet) { DefinitionSet annotation = definitionSet.getClass().getAnnotation(DefinitionSet.class); if (null != annotation) { Class<?>[] definitions = annotation.definitions(); if (definitions.length > 0) { result = new HashSet<Class<?>>(definitions.length); Collections.addAll(result, definitions); } } } return result; } }
@Override public Class<? extends ElementFactory> getGraphFactoryType(final T definitionSet) { Class<? extends ElementFactory> result = null; if (null != definitionSet) { DefinitionSet annotation = definitionSet.getClass().getAnnotation(DefinitionSet.class); if (null != annotation) { result = annotation.graphFactory(); } } return result; }
private void processDefinitionSetModelBuilder(final Element e, final String className, final Map<String, TypeConstructor> processingContextMap) { DefinitionSet definitionAnn = e.getAnnotation(DefinitionSet.class); TypeMirror bMirror = null; try { definitionAnn.builder(); } catch (MirroredTypeException mte) { bMirror = mte.getTypeMirror(); } if (null != bMirror && !VoidBuilder.class.getName().equals(bMirror.toString())) { String fqcn = bMirror.toString(); processingContextMap.put(className, TypeConstructor.builder(fqcn)); } }
@ApplicationScoped @Bindable @DefinitionSet( graphFactory = GraphFactory.class, definitions = {
List<? extends TypeMirror> mirrors = null; try { definitionSetAnn.definitions(); } catch (MirroredTypesException mte) { mirrors = mte.getTypeMirrors(); definitionSetAnn.graphFactory(); } catch (MirroredTypeException mte) { mirror = mte.getTypeMirror(); definitionSetAnn.qualifier(); } catch (MirroredTypeException mte) { mirror = mte.getTypeMirror();
@DefinitionSet(graphFactory = GraphFactory.class, qualifier = Default.class, definitions = {FooTestBean.class}) public class FooTestSet { @Title public static final String TITLE = "titleSet1"; @Description public static final String DESC = "descSet1"; }
@ApplicationScoped @Bindable @DefinitionSet( graphFactory = CaseManagementGraphFactory.class, qualifier = CaseManagementEditor.class,
protected Set<String> getAnnotatedDefinitions(final T definitionSet) { Set<String> result = null; if (null != definitionSet) { DefinitionSet annotation = definitionSet.getClass().getAnnotation(DefinitionSet.class); if (null != annotation) { Class<?>[] definitions = annotation.definitions(); if (definitions.length > 0) { result = new HashSet<String>(definitions.length); for (Class<?> defClass : definitions) { result.add(BindableAdapterUtils.getDefinitionSetId(defClass)); } } } } return result; }
@ApplicationScoped @Bindable @DefinitionSet( graphFactory = BPMNGraphFactory.class, qualifier = BPMN.class,