public class SpringFactory extends Object
|Constructor and Description|
|Modifier and Type||Method and Description|
Creates a feature map from a source map.
Loads a saved application state (gapp file) from the given Spring resource.
Convert a Spring resource to a URL.
public static FeatureMap createFeatureMap(Map<Object,Object> sourceMap) throws IOException
org.springframework.core.io.Resourceare converted to their corresponding
URL. For example:
<bean id="feature-map" class="gate.util.spring.SpringFactory" factory-method="createFeatureMap"> <constructor-arg> <map> <entry key="inputASName" value="Extra" /> <entry key="config"> <value type="org.springframework.core.io.Resource">path/to/config.xml</value> </entry> </map> </constructor-arg> </bean>For an easier way to achieve this see
FeatureMapFactoryBean, to which this method delegates.
public static Object loadObjectFromResource(org.springframework.core.io.Resource res) throws GateException, IOException
File, and if found the application is loaded using
loadObjectFromFile. If the resource cannot be accessed as a file it is accessed as a
URLand the application loaded with
loadObjectFromUrl. This is useful as many PRs either require or function better with file: URLs than with other kinds of URL. For an easier way to achieve this, see
SavedApplicationFactoryBean, to which this method delegates.
public static URL resourceToUrl(org.springframework.core.io.Resource res) throws IOException
File, and if this succeeds then the file is converted to a URL. If the resource cannot be accessed as a file then it is converted directly to a URL. This is useful as many PRs either require or function better with file: URLs than with other kinds of URL. In a Spring configuration this method may be accessed using the shorthand