|
Version: ${maven.project.version} | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler org.tulsoft.tools.xml.XMLErrorHandler org.soaplab.services.metadata.MetadataAccessorXML
public class MetadataAccessorXML
A default implementation of MetadataAccessor interface that reads service metadata from XML files.
How does it find metadata for its service?
It uses singleton AnalysisInventoryProvider
to get list of all available analyses
(possibly from more than one provider, i.e. possibly from more
analysis lists). It looks there for its analysis (whose name was
given in the constructor
). An analysis
info (a container class AnalysisInstallation
contains also
a poiner to an XML metadata file describing this analysis in all
details.
The pointer to an XML metadata file can be a URL, an absolute path,
or a relative path. In the last case, it is expanded to an absolute
path using Soaplab property Config.PROP_METADATA_DIR
, or even Config.PROP_METADATA_FILE
. In any case, if the path is still not
absolute, it is tried to locate the file as a class resource.
Field Summary |
---|
Fields inherited from class org.tulsoft.tools.xml.XMLErrorHandler |
---|
VERSION |
Constructor Summary | |
---|---|
MetadataAccessorXML(java.lang.String serviceName)
A real constructor. |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
characters() |
void |
checkMetadata()
Check if loaded metadata contains all necessary tags. |
java.lang.String |
describe()
Return the whole metadata in the raw format. |
void |
endDocument()
endDocument() |
void |
endElement(java.lang.String namespaceURI,
java.lang.String name,
java.lang.String qName)
endElement() |
AnalysisDef |
getAnalysisDef()
Methods of AnalysisMetadataAccessor interface Most of these public methods are synchronized in order to prevent returning uncomplete data if the parsing of metadata is in progress. |
InputPropertyDef[] |
getInputDefs()
Return a slightly simplified version of what is returned by MetadataAccessor.getParamDefs() - and only for input data and
options. |
OutputPropertyDef[] |
getOutputDefs()
Return a slightly simplified version of what is returned by MetadataAccessor.getParamDefs() - and only for output data. |
ParamDef[] |
getParamDefs()
Return description of all parameters for an analysis. |
java.lang.String |
getServiceName()
Return a name of a service providing this analysis. |
void |
setDocumentLocator(org.xml.sax.Locator l)
|
void |
startDocument()
startDocument() |
void |
startElement(java.lang.String namespaceURI,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes attrs)
startElement() |
Methods inherited from class org.tulsoft.tools.xml.XMLErrorHandler |
---|
error, fatalError, warning |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetadataAccessorXML(java.lang.String serviceName) throws SoaplabException
SoaplabException
Method Detail |
---|
public AnalysisDef getAnalysisDef()
getAnalysisDef
in interface MetadataAccessor
public ParamDef[] getParamDefs()
MetadataAccessor
getParamDefs
in interface MetadataAccessor
public InputPropertyDef[] getInputDefs()
MetadataAccessor
MetadataAccessor.getParamDefs()
- and only for input data and
options.
Some elements (parameters) returned by MetadataAccessor.getParamDefs()
can be represented here by more elements. For example, this
typically happens for input data that can be sent to an
analysis either as direct data, or as a reference to data. Such
input is represented by only one ParamDef
instance, but
by two elements returned by this getInputDefs.
The mapping between elements returned by MetadataAccessor.getParamDefs()
and by this method is done by parameter name: the names used by
this method are either same as those returned by MetadataAccessor.getParamDefs()
, or they have some additional suffixes. Soaplab
recognizes suffixes SoaplabConstants.DIRECT_DATA_SUFFIX
, SoaplabConstants.URL_SUFFIX
,SoaplabConstants.USA_SUFFIX
.
getInputDefs
in interface MetadataAccessor
public OutputPropertyDef[] getOutputDefs()
MetadataAccessor
MetadataAccessor.getParamDefs()
- and only for output data.
The mapping between elements returned by MetadataAccessor.getParamDefs()
and by this method is done by parameter name: the names used by
this method are the same as those returned by MetadataAccessor.getParamDefs()
.
getOutputDefs
in interface MetadataAccessor
public java.lang.String describe() throws SoaplabException
MetadataAccessor
describe
in interface MetadataAccessor
SoaplabException
- if metadata does not existpublic java.lang.String getServiceName() throws SoaplabException
MetadataAccessor
getServiceName
in interface MetadataAccessor
MetadataAccessor.getAnalysisDef()
SoaplabException
public void checkMetadata() throws SoaplabException
SoaplabException
public void setDocumentLocator(org.xml.sax.Locator l)
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
public void startDocument()
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
public void endDocument()
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
public void startElement(java.lang.String namespaceURI, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes attrs)
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
public void endElement(java.lang.String namespaceURI, java.lang.String name, java.lang.String qName)
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
public void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
|
Version: ${maven.project.version} | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |