|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgate.util.AbstractFeatureBearer
gate.creole.AbstractResource
gate.creole.AbstractLanguageResource
gate.creole.AnnotationSchema
This class handles annotation schemas.An annotation schema is a representation of an annotation, together with its types and their attributes, values and types.
Field Summary | |
protected String |
annotationName
The name of the annotation |
private static boolean |
DEBUG
Debug flag |
protected Set |
featureSchemaSet
Schemas for the attributes |
static String |
FILE_URL_PARAM_NAME
|
private static Map |
java2xSchemaMap
A map between JAva types and XSchema |
protected org.jdom.Namespace |
namespace
The namepsace used in the xml file |
protected URL |
xmlFileUrl
The xml file URL of the resource |
private static Map |
xSchema2JavaMap
A map between XSchema types and Java Types |
Fields inherited from class gate.creole.AbstractLanguageResource |
dataStore, lrPersistentId, serialVersionUID |
Fields inherited from class gate.creole.AbstractResource |
name |
Fields inherited from class gate.util.AbstractFeatureBearer |
features |
Constructor Summary | |
AnnotationSchema()
Constructs an annotation schema. |
Method Summary | |
void |
createAndAddFeatureSchemaObject(org.jdom.Element anAttributeElement)
This method creates and adds a FeatureSchema object to the current AnnotationSchema one. |
private void |
createAnnotationSchemaObject(org.jdom.Element anElement)
This method creates an AnnotationSchema object fom an org.jdom.Element |
void |
fromXSchema(InputStream anXSchemaInputStream)
Creates an AnnotationSchema object from an XSchema file |
void |
fromXSchema(URL anXSchemaURL)
Creates an AnnotationSchema object from an XSchema file |
String |
getAnnotationName()
Returns the value of annotation name |
FeatureSchema |
getFeatureSchema(String featureName)
|
Set |
getFeatureSchemaSet()
Returns the feature schema set |
URL |
getXmlFileUrl()
Get method for the resource xml file URL |
Resource |
init()
Initialise this resource, and return it. |
void |
setAnnotationName(String annotationName)
Sets the annotation name |
void |
setFeatureSchemaSet(Set featureSchemaSet)
Sets the feature schema set |
private static void |
setUpStaticData()
This sets up two Maps between XSchema types and their coresponding Java types + a DOM xml parser |
void |
setXmlFileUrl(URL xmlFileUrl)
Set method for the resource xml file URL |
String |
toXSchema()
|
private void |
workWithJDom(org.jdom.Document jDom)
This method uses the JDom structure for our XSchema needs. |
Methods inherited from class gate.creole.AbstractLanguageResource |
cleanup, getDataStore, getLRPersistenceId, getParent, isModified, setDataStore, setLRPersistenceId, setParent, sync |
Methods inherited from class gate.creole.AbstractResource |
checkParameterValues, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
Methods inherited from class gate.util.AbstractFeatureBearer |
getFeatures, setFeatures |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gate.Resource |
getParameterValue, setParameterValue, setParameterValues |
Methods inherited from interface gate.util.FeatureBearer |
getFeatures, setFeatures |
Methods inherited from interface gate.util.NameBearer |
getName, setName |
Field Detail |
public static final String FILE_URL_PARAM_NAME
private static final boolean DEBUG
private static Map xSchema2JavaMap
private static Map java2xSchemaMap
protected String annotationName
protected Set featureSchemaSet
protected URL xmlFileUrl
protected org.jdom.Namespace namespace
Constructor Detail |
public AnnotationSchema()
Method Detail |
private static void setUpStaticData() throws ResourceInstantiationException
ResourceInstantiationException
public String getAnnotationName()
public void setAnnotationName(String annotationName)
public Set getFeatureSchemaSet()
public void setFeatureSchemaSet(Set featureSchemaSet)
public FeatureSchema getFeatureSchema(String featureName)
public Resource init() throws ResourceInstantiationException
init
in interface Resource
init
in class AbstractResource
ResourceInstantiationException
public void setXmlFileUrl(URL xmlFileUrl)
public URL getXmlFileUrl()
public void fromXSchema(URL anXSchemaURL) throws ResourceInstantiationException
anXSchemaURL
- the URL where to find the XSchema file
ResourceInstantiationException
public void fromXSchema(InputStream anXSchemaInputStream) throws ResourceInstantiationException
anXSchemaInputStream
- the Input Stream containing the XSchema file
ResourceInstantiationException
private void workWithJDom(org.jdom.Document jDom)
jDom
- the JDOM structure containing the XSchema document. It must not
be nullprivate void createAnnotationSchemaObject(org.jdom.Element anElement)
anElement
- is an XSchema element elementpublic void createAndAddFeatureSchemaObject(org.jdom.Element anAttributeElement)
public String toXSchema()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |