public Set<TypeDef> getDefinitions(AttributeKey<Boolean>... attributeKeys) { Set<TypeDef> result = new LinkedHashSet<TypeDef>(); for (TypeDef candidate : definitions.values()) { boolean matches = true; for (AttributeKey<Boolean> attributeKey : attributeKeys) { if (!candidate.hasAttribute(attributeKey) || !(candidate.getAttribute(attributeKey))) { matches = false; break; } } if (matches) { result.add(candidate); } } return Collections.unmodifiableSet(result); }
public Set<TypeDef> getDefinitions(String... flags) { Set<TypeDef> result = new LinkedHashSet<TypeDef>(); for (TypeDef candidate : definitions.values()) { boolean matches = true; for (String flag :flags) { AttributeKey<Boolean> attributeKey = new AttributeKey<Boolean>(flag, Boolean.class); if (!candidate.hasAttribute(attributeKey) || !(candidate.getAttribute(attributeKey))) { matches = false; break; } } if (matches) { result.add(candidate); } } return Collections.unmodifiableSet(result); }
public Set<TypeDef> apply(TypeDef item) { if (item.equals(TypeDef.OBJECT)) { return new LinkedHashSet<TypeDef>(); } Set<TypeDef> result = new LinkedHashSet<TypeDef>(); BuilderContext ctx = BuilderContextManager.getContext(); BuildableRepository repository = ctx.getBuildableRepository(); for (TypeDef type : repository.getBuildables()) { if (type.getKind() == Kind.CLASS && !type.isAbstract() && isDescendant(type, item) && !type.equals(item) && !type.hasAttribute(GENERATED)) { result.add(type); } } return result; } });
additonalBuildables.add(typeDef); if (typeDef.hasAttribute(ADDITIONAL_BUILDABLES)) { for (TypeDef also : typeDef.getAttribute(ADDITIONAL_BUILDABLES)) { builderContext.getDefinitionRepository().register(also); if (typeDef.hasAttribute(ADDITIONAL_TYPES)) { for (TypeDef also : typeDef.getAttribute(ADDITIONAL_TYPES)) { builderContext.getDefinitionRepository().register(also);
public TypeDef apply(final TypeDef item) { final boolean validationEnabled = item.hasAttribute(VALIDATION_ENABLED) ? item.getAttribute(VALIDATION_ENABLED) : false; final Modifier[] modifiers = item.isAbstract() ? new Modifier[]{Modifier.PUBLIC, Modifier.ABSTRACT}