/** * Allows subclasses to alter the result generation * @param count * @param results * @param lockId * @return */ protected FeatureCollectionType buildResults(int count, List results, String lockId) { VersionedFeatureCollectionType result = WfsvFactory.eINSTANCE.createVersionedFeatureCollectionType(); result.setNumberOfFeatures(BigInteger.valueOf(count)); result.setTimeStamp(Calendar.getInstance()); result.setLockId(lockId); result.getFeature().addAll(results); result.setVersion("xxx"); return result; }
@Override public Object unadapt(Class target) { if (target.equals(net.opengis.wfs20.FeatureCollectionType.class)) { return adaptee; } else if (target.equals(FeatureCollectionType.class)) { net.opengis.wfs20.FeatureCollectionType source = (net.opengis.wfs20.FeatureCollectionType) adaptee; FeatureCollectionType result = WfsFactory.eINSTANCE.createFeatureCollectionType(); result.getFeature().addAll(source.getMember()); result.setNumberOfFeatures(source.getNumberReturned()); result.setLockId(source.getLockId()); result.setTimeStamp(source.getTimeStamp()); return result; } else { throw new WFSException( "Cannot transform " + adaptee + " to the specified target class " + target); } } }