Search in sources :

Example 1 with PropertyInterpreter

use of org.apache.knox.gateway.topology.builder.property.interpreter.PropertyInterpreter in project knox by apache.

the class PropertyTopologyBuilder method build.

public Topology build() {
    Topology topology = new Topology();
    PropertyInterpreter propertyInterpreter = new PropertyInterpreter(topology);
    for (Property property : properties) {
        try {
            propertyInterpreter.interpret(property.getName(), property.getValue());
        } catch (InterpretException ie) {
            log.failedToInterpretProperty(property.getName(), ie);
            throw new IllegalArgumentException(gatewayResources.wrongTopologyDataFormatError());
        }
    }
    return topology;
}
Also used : InterpretException(org.apache.knox.gateway.topology.builder.property.interpreter.InterpretException) PropertyInterpreter(org.apache.knox.gateway.topology.builder.property.interpreter.PropertyInterpreter) Topology(org.apache.knox.gateway.topology.Topology) Property(org.apache.knox.gateway.topology.builder.property.Property)

Aggregations

Topology (org.apache.knox.gateway.topology.Topology)1 Property (org.apache.knox.gateway.topology.builder.property.Property)1 InterpretException (org.apache.knox.gateway.topology.builder.property.interpreter.InterpretException)1 PropertyInterpreter (org.apache.knox.gateway.topology.builder.property.interpreter.PropertyInterpreter)1