use of org.geotoolkit.ogc.xml.v110.LiteralType in project ddf by codice.
the class CswQueryFactoryTest method createTemporalBinaryComparisonOpType.
private BinaryComparisonOpType createTemporalBinaryComparisonOpType(String attr, String comparison) {
BinaryComparisonOpType comparisonOp = new BinaryComparisonOpType();
PropertyNameType propName = new PropertyNameType();
propName.getContent().add(attr);
comparisonOp.getExpression().add(filterObjectFactory.createPropertyName(propName));
LiteralType literal = new LiteralType();
literal.getContent().add(comparison);
comparisonOp.getExpression().add(filterObjectFactory.createLiteral(literal));
return comparisonOp;
}
use of org.geotoolkit.ogc.xml.v110.LiteralType in project ddf by codice.
the class WfsFilterDelegate method createLiteralType.
private JAXBElement<LiteralType> createLiteralType(Object literalValue) {
JAXBElement<LiteralType> literalType = filterObjectFactory.createLiteral(new LiteralType());
literalType.getValue().getContent().add(literalValue.toString());
return literalType;
}
use of org.geotoolkit.ogc.xml.v110.LiteralType in project arctic-sea by 52North.
the class FesDecoderv20 method parsePropertyIsBetweenFilter.
/**
* Parse XML propertyIsBetween element
*
* @param comparisonOpsType
* XML propertyIsBetween element
* @return SOS comparison filter
* @throws DecodingException
* If an error occurs of the filter is not supported
*/
private ComparisonFilter parsePropertyIsBetweenFilter(PropertyIsBetweenType comparisonOpsType) throws DecodingException {
ComparisonFilter comparisonFilter = new ComparisonFilter();
comparisonFilter.setOperator(ComparisonOperator.PropertyIsBetween);
try {
comparisonFilter.setValueReference(parseValueReference(comparisonOpsType.getExpression()));
} catch (XmlException xmle) {
throw valueReferenceParsingException(xmle);
}
if (comparisonOpsType.getLowerBoundary().getExpression() instanceof LiteralType) {
comparisonFilter.setValue(parseLiteralValue((LiteralType) comparisonOpsType.getLowerBoundary().getExpression()));
}
if (comparisonOpsType.getUpperBoundary().getExpression() instanceof LiteralType) {
comparisonFilter.setValueUpper(parseLiteralValue((LiteralType) comparisonOpsType.getUpperBoundary().getExpression()));
}
return comparisonFilter;
}
use of org.geotoolkit.ogc.xml.v110.LiteralType in project flytekit-java by flyteorg.
the class SdkTestingExecutor method withFixedInputs.
public <T> SdkTestingExecutor withFixedInputs(SdkType<T> type, T value) {
Map<String, Variable> variableMap = type.getVariableMap();
@Var Builder builder = toBuilder();
for (Map.Entry<String, Literal> entry : type.toLiteralMap(value).entrySet()) {
LiteralType literalType = variableMap.get(entry.getKey()).literalType();
builder = builder.putFixedInput(entry.getKey(), entry.getValue(), literalType);
}
return builder.build();
}
use of org.geotoolkit.ogc.xml.v110.LiteralType in project flytekit-java by flyteorg.
the class SdkTestingExecutor method execute.
public Result execute() {
TestingSdkWorkflowBuilder builder = new TestingSdkWorkflowBuilder(fixedInputMap(), fixedInputTypeMap());
workflow().expand(builder);
WorkflowTemplate workflowTemplate = builder.toIdlTemplate();
for (Node node : workflowTemplate.nodes()) {
TaskNode taskNode = node.taskNode();
if (taskNode != null) {
String taskName = taskNode.referenceId().name();
checkArgument(fixedTaskMap().containsKey(taskName), "Can't execute remote task [%s], " + "use SdkTestingExecutor#withTaskOutput or SdkTestingExecutor#withTask", taskName);
}
}
Map<String, Literal> outputLiteralMap = LocalEngine.compileAndExecute(workflowTemplate, unmodifiableMap(fixedTaskMap()), emptyMap(), fixedInputMap());
Map<String, LiteralType> outputLiteralTypeMap = workflowTemplate.interface_().outputs().entrySet().stream().collect(toMap(Map.Entry::getKey, x -> x.getValue().literalType()));
return Result.create(outputLiteralMap, outputLiteralTypeMap);
}
Aggregations