use of org.jboss.weld.bootstrap.spi.SystemPropertyActivation in project core by weld.
the class BeansXmlStreamParser method systemProperty.
private void systemProperty(StartElement element, Consumer<Metadata<SystemPropertyActivation>> consumer) {
String name = getAttribute(element, NAME_ATTRIBUTE_NAME);
String value = getAttribute(element, VALUE_ATTRIBUTE_NAME);
Metadata<SystemPropertyActivation> activation = new XmlMetadata<SystemPropertyActivation>(element.getName().toString(), new SystemPropertyActivationImpl(name, value), beansXml, element.getLocation().getLineNumber());
consumer.accept(activation);
}
use of org.jboss.weld.bootstrap.spi.SystemPropertyActivation 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