public class GateResourceFactoryBean extends GateAwareObject implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.DisposableBean
gate: extension namespace,
e.g.:
<gate:resource id="doc" scope="prototype"
resource-class="gate.corpora.DocumentImpl"
resource-name="News document">
<gate:parameters>
<entry key="sourceUrl">
<value type="org.springframework.core.io.Resource">resources/doc.xm</value>
</entry>
<entry key="preserveOriginalContent" value="true" />
</gate:parameters>
<gate:features>
<entry key="genre" value="news" />
</gate:features>
<gate:customisers>
<!-- optional list of ResourceCustomisers applied to the resource after creation -->
</gate:customisers>
</gate:resource>
The gate:parameters and gate:features
elements are FeatureMaps giving the init-time parameters and features
for the resource respectively. Any Spring Resource values in these
maps are converted to URLs, so the rest of the GATE code does not
need to know about Spring. For details of how to declare the
gate namespace, see Init.| Constructor and Description |
|---|
GateResourceFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy the resource created by this bean, by passing it to
Factory.deleteResource(gate.Resource). |
Object |
getObject()
Create the resource specified by this bean.
|
Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setCustomisers(List<ResourceCustomiser> customisers) |
void |
setFeatures(gate.FeatureMap features) |
void |
setParameters(gate.FeatureMap parameters) |
void |
setResourceClass(String resourceClass) |
void |
setResourceName(String resourceName) |
ensureGateInit, setBeanFactorypublic Object getObject() throws Exception
getObject in interface org.springframework.beans.factory.FactoryBeanExceptionpublic Class<?> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBeanpublic boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBeanpublic void destroy()
throws Exception
Factory.deleteResource(gate.Resource).destroy in interface org.springframework.beans.factory.DisposableBeanExceptionpublic void setResourceClass(String resourceClass)
public void setResourceName(String resourceName)
public void setParameters(gate.FeatureMap parameters)
public void setFeatures(gate.FeatureMap features)
public void setCustomisers(List<ResourceCustomiser> customisers)
Copyright © 2023 GATE. All rights reserved.