* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
List<Node> timePositions = node.getChildren("timePosition");
TimeSequenceType results = Wcs111Factory.eINSTANCE.createTimeSequenceType();
if (timePositions != null && !timePositions.isEmpty()) {
for (Node timePositionNode : timePositions) {
Date positionDate = ((Position) timePositionNode.getValue()).getDate();
results.getTimePosition().add(cvtToGmt(positionDate));
}
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 = Wcs111Factory.eINSTANCE.createTimePeriodType();
Date beginPosition = cvtToGmt(begining.getPosition().getDate());
Date endPosition = cvtToGmt(ending.getPosition().getDate());
timePeriod.setBeginPosition(beginPosition);
timePeriod.setEndPosition(endPosition);
results.getTimePeriod().add(timePeriod);
}
return results;
}
}