/** * Returns the {@linkplain FilterFactory filter factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public FilterFactory getFilterFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(FilterFactory.class)); }
@Override public WFSResponse createResponse(HTTPResponse response) throws IOException { final String contentType = response.getContentType(); if (contentType == null) { Logging.getLogger(WFSRequest.class) .warning( this.getOperation() + " request returned null content type for URL " + getFinalURL()); } WFSResponseFactory responseFactory; try { responseFactory = WFSExtensions.findResponseFactory(this, contentType); } catch (FactoryNotFoundException fnf) { Loggers.MODULE.log(Level.WARNING, fnf.getMessage()); try { if (contentType != null && contentType.startsWith("text")) { byte buff[] = new byte[1024]; response.getResponseStream().read(buff); Loggers.MODULE.info("Failed response snippet: " + new String(buff)); } throw fnf; } catch (Exception ignore) { throw fnf; } } WFSResponse wfsResponse = responseFactory.createResponse(this, response); return wfsResponse; }
/** * Returns the {@linkplain NameFactory name factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public NameFactory getNameFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(NameFactory.class)); }
/** * Returns the {@linkplain CitationFactory citation factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public CitationFactory getCitationFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(CitationFactory.class)); }
/** * Returns the {@linkplain FeatureDisplayFactory feature display factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public FeatureDisplayFactory getFeatureDisplayFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(FeatureDisplayFactory.class)); }
/** * Returns the {@linkplain DisplayFactory display factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public DisplayFactory getDisplayFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(DisplayFactory.class)); }
/** * Returns the {@linkplain NameFactory name factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public NameFactory getNameFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(NameFactory.class)); }
/** * Returns the {@linkplain FeatureTypeFactory feature type factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public TypeFactory getTypeFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(TypeFactory.class)); }
/** * Returns the {@linkplain CitationFactory citation factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public CitationFactory getCitationFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(CitationFactory.class)); }
/** * Returns the {@linkplain FeatureStyleFactory feature style factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public FeatureStyleFactory getFeatureStyleFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(FeatureStyleFactory.class)); }
/** * Returns the {@linkplain FilterFactory filter factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public FilterFactory getFilterFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(FilterFactory.class)); }
/** * Returns the {@linkplain FeatureTypeFactory feature type factory} singleton. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. * * @deprecated use {@link #getFeatureTypeFactory()}. * @since 2.5 */ public FeatureTypeFactory getFeatureTypeFactory() throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(FeatureTypeFactory.class)); }
private static FilterFactory2 findFactory2() { Set factories = CommonFactoryFinder.getFilterFactories(GeoTools.getDefaultHints()); for (Iterator iter = factories.iterator(); iter.hasNext();) { FilterFactory factory = (FilterFactory) iter.next(); if (factory instanceof FilterFactory2) { return (FilterFactory2) factory; } } throw new FactoryNotFoundException("There is no FilterFactory2 instance available for the default system hints"); }
/** * Returns the {@linkplain GeometryFactory geometry factory} equiped to build geometries * using the given {@linkplain CoordinateReferenceSystem coordinate reference system}. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @param crs the {@linkplain CoordinateReferenceSystem coordinate reference system} the * {@linkplain GeometryFactory geometry factory} should use. * @return the requested {@linkplain GeometryFactory geometry factory} or {@code null} if the * {@linkplain CoordinateReferenceSystem coordinate reference system} is not supported. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public GeometryFactory getGeometryFactory(final CoordinateReferenceSystem crs) throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(GeometryFactory.class)); }
/** * Returns the {@linkplain GeometryFactory geometry factory} equiped to build geometries * using the given {@linkplain CoordinateReferenceSystem coordinate reference system}. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @param crs the {@linkplain CoordinateReferenceSystem coordinate reference system} the * {@linkplain GeometryFactory geometry factory} should use. * @return the requested {@linkplain GeometryFactory geometry factory} or {@code null} if the * {@linkplain CoordinateReferenceSystem coordinate reference system} is not supported. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public GeometryFactory getGeometryFactory(final CoordinateReferenceSystem crs) throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(GeometryFactory.class)); }
/** * Returns the {@linkplain PrimitiveFactory primitive factory} equiped to build primitives * using the given {@linkplain CoordinateReferenceSystem coordinate reference system}. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @param crs the {@linkplain CoordinateReferenceSystem coordinate reference system} the * {@linkplain PrimitiveFactory primitive factory} should use. * @return the requested {@linkplain PrimitiveFactory primitive factory} or {@code null} if the * {@linkplain CoordinateReferenceSystem coordinate reference system} is not supported. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public PrimitiveFactory getPrimitiveFactory(final CoordinateReferenceSystem crs) throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(PrimitiveFactory.class)); } }
/** * Returns the {@linkplain PrimitiveFactory primitive factory} equiped to build primitives * using the given {@linkplain CoordinateReferenceSystem coordinate reference system}. * <p> * <strong>NOTE:</strong> This method is not yet supported in Geotools. * The default implementation thrown an exception in all case. * * @param crs the {@linkplain CoordinateReferenceSystem coordinate reference system} the * {@linkplain PrimitiveFactory primitive factory} should use. * @return the requested {@linkplain PrimitiveFactory primitive factory} or {@code null} if the * {@linkplain CoordinateReferenceSystem coordinate reference system} is not supported. * * @throws FactoryNotFoundException if no factory was found for the requested type. * @throws FactoryRegistryException if the factory can't be obtained for an other reason. */ public PrimitiveFactory getPrimitiveFactory(final CoordinateReferenceSystem crs) throws FactoryRegistryException { throw new FactoryNotFoundException(unsupportedFactory(PrimitiveFactory.class)); } }
/** * @param requestType * @param outputFormat * @return * @throws FactoryNotFoundException */ static WFSResponseParserFactory findParserFactory(EObject request) { Iterator<WFSResponseParserFactory> serviceProviders; serviceProviders = getServiceProviders(); WFSResponseParserFactory factory; while (serviceProviders.hasNext()) { factory = serviceProviders.next(); if (factory.isAvailable()) { if (factory.canProcess(request)) { return factory; } } } throw new FactoryNotFoundException("Can't find a response parser factory for " + request); }
/** * @param originatingRequest * @param contentType * @return * @throws FactoryNotFoundException */ public static WFSResponseFactory findResponseFactory( final WFSRequest originatingRequest, final String contentType) { Iterator<WFSResponseFactory> serviceProviders; serviceProviders = getServiceProviders(); WFSResponseFactory factory; while (serviceProviders.hasNext()) { factory = serviceProviders.next(); if (factory.isAvailable()) { if (factory.canProcess(originatingRequest, contentType)) { return factory; } } } throw new FactoryNotFoundException( "Can't find a response parser factory for " + originatingRequest.getOperation() + "/'" + contentType + "'"); }
debug("THROW", category, key, "could not find implementation.", null); throw new FactoryNotFoundException(Errors.format(ErrorKeys.FACTORY_NOT_FOUND_$1, implementation!=null ? implementation : category));