com.languagecomputer.api
Class DefaultAnnotationMetaService

java.lang.Object
  extended by com.languagecomputer.api.DefaultAnnotationMetaService
All Implemented Interfaces:
AnnotationMetaService, Service

public class DefaultAnnotationMetaService
extends Object
implements AnnotationMetaService

Default implementation of the AnnotationMetaService.

Since:
1.0
Author:
Kirk Roberts

Constructor Summary
DefaultAnnotationMetaService()
           
 
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 AnnotationMetaService.
 Document process(URL url, String type, List<String> services)
          Process the given URL of the given type, then annotate the given services.
 void setSession(Session session)
          Sets the Session this Service instance is associated with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAnnotationMetaService

public DefaultAnnotationMetaService()
Method Detail

getName

public String getName()
Returns AnnotationMetaService.

Specified by:
getName in interface Service

setSession

public void setSession(Session session)
Sets the Session this Service instance is associated with. Properties can be retrieved with Session.getProperties().

Specified by:
setSession in interface Service

process

public Document process(URL url,
                        String type,
                        List<String> services)
                 throws IOException
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.
type - (Advanced Users) Optional file type to force.
Returns:
A processed Document corresponding to the given url.
Throws:
IOException - If there was a problem reading the 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.