com.languagecomputer.api
Class AnnotationMetaServiceWebClient

java.lang.Object
  extended by com.languagecomputer.api.BaseWebClient<AnnotationMetaWebService>
      extended by com.languagecomputer.api.AnnotationMetaServiceWebClient
All Implemented Interfaces:
AnnotationMetaService, Service

public class AnnotationMetaServiceWebClient
extends BaseWebClient<AnnotationMetaWebService>
implements AnnotationMetaService

Web service client wrapper for the AnnotationMetaService. Handles all the web service interaction code. Combined with the AnnotationMetaService class, this provides a java-to-java interaction that masks the web service functionality.

Since:
1.0
Author:
Kirk Roberts

Constructor Summary
AnnotationMetaServiceWebClient(ServiceConfig serviceConfig)
          Creates a new AnnotationMetaServiceWebClient with the given ServiceConfig.
 
Method Summary
 void annotate(Document document, List<String> services)
          Process the given Document with the given services.
 AnnotationType getAnnotationType(String service)
          Returns the AnnotationType that corresponds to the given service.
 String getName()
          Returns the name of the service to use for URL lookup.
protected  Class<AnnotationMetaWebService> getWebServiceClass()
          Returns the BaseWebService class this BaseWebClient wraps.
 Document process(URL url, String fileType, List<String> services)
          Process the given URL of the given type, then annotate the given services.
 
Methods inherited from class com.languagecomputer.api.BaseWebClient
disconnect, getSessionID, getWebService, registerSession, sessionRegistered, setSession, setSessionID, unregisterSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.languagecomputer.api.Service
setSession
 

Constructor Detail

AnnotationMetaServiceWebClient

public AnnotationMetaServiceWebClient(ServiceConfig serviceConfig)
Creates a new AnnotationMetaServiceWebClient with the given ServiceConfig.

Method Detail

getName

public String getName()
Returns the name of the service to use for URL lookup.

Specified by:
getName in interface Service
Specified by:
getName in class BaseWebClient<AnnotationMetaWebService>

getWebServiceClass

protected Class<AnnotationMetaWebService> getWebServiceClass()
Returns the BaseWebService class this BaseWebClient wraps.

Specified by:
getWebServiceClass in class BaseWebClient<AnnotationMetaWebService>

process

public Document process(URL url,
                        String fileType,
                        List<String> services)
Process the given URL of the given type, then annotate the given services.

Specified by:
process in interface AnnotationMetaService
Parameters:
url - java.net.URL of the file to process.
fileType - (Advanced Users) Optional file type to force.
Returns:
A processed Document corresponding to the given url.

annotate

public void annotate(Document document,
                     List<String> services)
Process the given Document with the given services.

Specified by:
annotate in interface AnnotationMetaService
Parameters:
document - Document to process.
services - List of services to run. In most cases, the services should be run in the order specified, unless a re-order is necessary for dependencies.

getAnnotationType

public AnnotationType getAnnotationType(String service)
Returns the AnnotationType that corresponds to the given service. Returns null if the service is not recognized.

Specified by:
getAnnotationType in interface AnnotationMetaService
Parameters:
service - Name of the Service.
Returns:
The AnnotationType the given service is responsible for.


Copyright © 2009. All Rights Reserved.