* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
List<Node> timePositions = node.getChildren("timePosition");
TimeSequenceType results = Wcs10Factory.eINSTANCE.createTimeSequenceType();
if (timePositions != null && !timePositions.isEmpty()) {
for (Node timePositionNode : timePositions) {
TimePositionType timePosition = Gml4wcsFactory.eINSTANCE.createTimePositionType();
Date positionDate = ((Position) timePositionNode.getValue()).getDate();
timePosition.setValue(positionDate);
results.getTimePosition().add(timePosition);
}
return results;
} else {
List<Node> timePeriods = node.getChildren("timePeriod");
if (timePeriods != null && !timePeriods.isEmpty()) {
for (Node timePeriodNode : timePeriods) {
Instant begining = new DefaultInstant((Position) timePeriodNode.getChild("beginPosition").getValue());
Instant ending = new DefaultInstant((Position) timePeriodNode.getChild("endPosition").getValue());
//Period timePeriod = new DefaultPeriod(begining, ending);
TimePeriodType timePeriod = Wcs10Factory.eINSTANCE.createTimePeriodType();
TimePositionType beginPosition = Gml4wcsFactory.eINSTANCE.createTimePositionType();
TimePositionType endPosition = Gml4wcsFactory.eINSTANCE.createTimePositionType();
beginPosition.setValue(begining.getPosition().getDate());
endPosition.setValue(ending.getPosition().getDate());
timePeriod.setBeginPosition(beginPosition);
timePeriod.setEndPosition(endPosition);
results.getTimePeriod().add(timePeriod);
}
return results;
}
}