org.peaseplate.service
Interface DesignatorService

All Known Implementing Classes:
DefaultDesignatorService

public interface DesignatorService


Method Summary
 void add(java.lang.Class<? extends Designator> designatorClass)
          Adds the specified designator to the service.
 void add(java.lang.ClassLoader... classLoaders)
          Scans the specified class loaders for designator service definitions.
 void add(Designator designator)
          Adds the specified designator to the service.
 Designator get(java.lang.String keyword)
          Returns the designator with the specified keyword
 Designator getDefaultDesignator()
          Returns the designator specified by the default designator keyword
 java.lang.String getDefaultDesignatorKeyword()
          Returns the keyword of the default designator (the designator that is used if none is specified; the default is "print")
 void setDefaultDesignatorKeyword(java.lang.String defaultDesignatorKeyword)
          Sets the keyword of the default designator.
 

Method Detail

add

void add(java.lang.ClassLoader... classLoaders)
         throws java.lang.IllegalArgumentException
Scans the specified class loaders for designator service definitions. The definitions are located in a resource with the name "META-INF/services/org.peaseplate.service.DesignatorService". The file contains class names of Designators, one class name per line.

Parameters:
classLoaders - the class loaders
Throws:
java.lang.IllegalArgumentException - if a class could not be instantiated

add

void add(java.lang.Class<? extends Designator> designatorClass)
         throws java.lang.IllegalArgumentException
Adds the specified designator to the service. Create a new instance of the class immediately. If there already exists another designator with the same name it will get replaced by the specified designator.

Parameters:
designatorClass - the class of the designator
Throws:
java.lang.IllegalArgumentException - if the instance could not be created

add

void add(Designator designator)
Adds the specified designator to the service. If there already exists another designator with the same name it will get replaced by the specified designator.

Parameters:
designator - the designator

get

Designator get(java.lang.String keyword)
Returns the designator with the specified keyword

Parameters:
keyword - the keyword
Returns:
the designator or null if not found

getDefaultDesignatorKeyword

java.lang.String getDefaultDesignatorKeyword()
Returns the keyword of the default designator (the designator that is used if none is specified; the default is "print")

Returns:
the keyword of the default designator

setDefaultDesignatorKeyword

void setDefaultDesignatorKeyword(java.lang.String defaultDesignatorKeyword)
Sets the keyword of the default designator.

Parameters:
defaultDesignatorKeyword - the keyword

getDefaultDesignator

Designator getDefaultDesignator()
                                throws java.lang.IllegalStateException
Returns the designator specified by the default designator keyword

Returns:
the default designator
Throws:
java.lang.IllegalStateException - if the default designator does not exist


Copyright © 2008. All Rights Reserved.