Search in sources :

Example 1 with Direction

use of com.dexels.navajo.document.stream.api.Prop.Direction in project navajo by Dexels.

the class NavajoDomStreamer method create.

private static Prop create(Property tmlProperty) {
    String type = tmlProperty.getType();
    List<Select> selections = selectFromTml(tmlProperty.getAllSelections());
    String value = null;
    Binary binary = null;
    if (Property.BINARY_PROPERTY.equals(type)) {
        value = null;
        binary = (Binary) tmlProperty.getTypedValue();
    } else if (Property.SELECTION_PROPERTY.equals(type)) {
        value = null;
    } else {
        value = tmlProperty.getValue();
    }
    Optional<Direction> direction = "in".equals(tmlProperty.getDirection()) ? Optional.of(Direction.IN) : "out".equals(tmlProperty.getDirection()) ? Optional.of(Direction.OUT) : Optional.empty();
    return Prop.create(tmlProperty.getName(), value, tmlProperty.getType(), selections, direction, tmlProperty.getDescription(), tmlProperty.getLength(), tmlProperty.getSubType(), Optional.ofNullable(tmlProperty.getCardinality()), binary);
}
Also used : Select(com.dexels.navajo.document.stream.api.Select) Binary(com.dexels.navajo.document.types.Binary) Direction(com.dexels.navajo.document.stream.api.Prop.Direction)

Aggregations

Direction (com.dexels.navajo.document.stream.api.Prop.Direction)1 Select (com.dexels.navajo.document.stream.api.Select)1 Binary (com.dexels.navajo.document.types.Binary)1