use of org.jboss.weld.bootstrap.spi.ClassAvailableActivation in project core by weld.
the class BeansXmlStreamParser method classAvailable.
private void classAvailable(StartElement element, Consumer<Metadata<ClassAvailableActivation>> consumer, boolean inverse) {
String className = getAttribute(element, NAME_ATTRIBUTE_NAME);
Metadata<ClassAvailableActivation> classAvailableActivation = new XmlMetadata<ClassAvailableActivation>(element.getName().toString(), new ClassAvailableActivationImpl(className, inverse), beansXml, element.getLocation().getLineNumber());
consumer.accept(classAvailableActivation);
}
use of org.jboss.weld.bootstrap.spi.ClassAvailableActivation in project core by weld.
the class JsonObjects method createFilterJsonArray.
static JsonObjectBuilder createFilterJsonArray(Filter filter, String type) {
JsonObjectBuilder filterBuilder = Json.objectBuilder(true);
filterBuilder.add(TYPE, type);
filterBuilder.add(NAME, filter.getName());
JsonArrayBuilder activationsBuilder = Json.arrayBuilder(true);
filterBuilder.add(ACTIVATIONS, activationsBuilder);
if (filter.getClassAvailableActivations() != null && !filter.getClassAvailableActivations().isEmpty()) {
for (Metadata<ClassAvailableActivation> metadata : filter.getClassAvailableActivations()) {
activationsBuilder.add(Json.objectBuilder().add(INVERTED, metadata.getValue().isInverted()).add(CLASS_AVAILABILITY, metadata.getValue().getClassName()));
}
}
if (filter.getSystemPropertyActivations() != null && !filter.getSystemPropertyActivations().isEmpty()) {
for (Metadata<SystemPropertyActivation> metadata : filter.getSystemPropertyActivations()) {
JsonObjectBuilder sysPropBuilder = Json.objectBuilder().add(SYS_PROPERTY, metadata.getValue().getName());
if (metadata.getValue().getValue() != null) {
sysPropBuilder.add(VALUE, metadata.getValue().getValue());
}
activationsBuilder.add(sysPropBuilder);
}
}
return filterBuilder;
}
Aggregations