gate.util.spring.FeatureMapFactoryBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gate-spring Show documentation
Show all versions of gate-spring Show documentation
Helper classes to support the use of GATE within the Spring framework
/*
* FeatureMapFactoryBean.java
*
* Copyright (c) 1995-2012, The University of Sheffield. See the file
* COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
*
* This file is part of GATE (see http://gate.ac.uk/), and is free
* software, licenced under the GNU Library General Public License,
* Version 2, June 1991 (in the distribution as file licence.html,
* and also available at http://gate.ac.uk/gate/licence.html).
*
* Ian Roberts, 22/Jan/2008
*
* $Id: FeatureMapFactoryBean.java 17657 2014-03-14 09:08:56Z markagreenwood $
*/
package gate.util.spring;
import gate.Factory;
import gate.FeatureMap;
import java.io.IOException;
import java.util.Map;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.core.io.Resource;
/**
* Spring FactoryBean to create a FeatureMap from a source Map
* (typically one created with a <map> element in a spring config
* file). Values in the source map whose type is Spring "Resource" are
* converted to URLs in the feature map (file: URLs if possible). If you
* are defining the source map inline (as opposed to ref-ing another
* bean) the following shorthand is available.
*
*
* <gate:feature-map>
* <entry key="kind" value="word" />
* </gate:feature-map>
*
*
* The entry
elements follow the same pattern as those in
* a <map>
element in normal Spring configuration.
* See {@link Init} for an example of how to include the
* gate
namespace.
*/
public class FeatureMapFactoryBean extends GateAwareObject implements
FactoryBean {
private Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy