org.fourthline.cling.binding.annotations
Class AnnotationLocalServiceBinder

java.lang.Object
  extended by org.fourthline.cling.binding.annotations.AnnotationLocalServiceBinder
All Implemented Interfaces:
LocalServiceBinder

public class AnnotationLocalServiceBinder
extends Object
implements LocalServiceBinder

Reads LocalService metadata from annotations.

Author:
Christian Bauer

Constructor Summary
AnnotationLocalServiceBinder()
           
 
Method Summary
protected  boolean isActionExcluded(Action action)
          Override this method to exclude action/methods after they have been discovered.
 LocalService read(Class<?> clazz)
           
 LocalService read(Class<?> clazz, ServiceId id, ServiceType type, boolean supportsQueryStateVariables, Class[] stringConvertibleTypes)
           
 LocalService read(Class<?> clazz, ServiceId id, ServiceType type, boolean supportsQueryStateVariables, Set<Class> stringConvertibleTypes)
           
protected  Map<Action,ActionExecutor> readActions(Class<?> clazz, Map<StateVariable,StateVariableAccessor> stateVariables, Set<Class> stringConvertibleTypes)
           
protected  Map<StateVariable,StateVariableAccessor> readStateVariables(Class<?> clazz, Set<Class> stringConvertibleTypes)
           
protected  Set<Class> readStringConvertibleTypes(Class[] declaredTypes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationLocalServiceBinder

public AnnotationLocalServiceBinder()
Method Detail

read

public LocalService read(Class<?> clazz)
                  throws LocalServiceBindingException
Specified by:
read in interface LocalServiceBinder
Parameters:
clazz - The Java class that is the source of the service metadata.
Returns:
The produced metadata.
Throws:
LocalServiceBindingException - If binding failed.

read

public LocalService read(Class<?> clazz,
                         ServiceId id,
                         ServiceType type,
                         boolean supportsQueryStateVariables,
                         Class[] stringConvertibleTypes)
                  throws LocalServiceBindingException
Specified by:
read in interface LocalServiceBinder
Parameters:
clazz - The Java class that is the source of the service metadata.
id - The pre-defined identifier of the service.
type - The pre-defined type of the service.
supportsQueryStateVariables - true if the service should support the deprecated "query any state variable value" action.
stringConvertibleTypes - A list of Java classes which map directly to string-typed UPnP state variables.
Returns:
The produced metadata.
Throws:
LocalServiceBindingException - If binding failed.

read

public LocalService read(Class<?> clazz,
                         ServiceId id,
                         ServiceType type,
                         boolean supportsQueryStateVariables,
                         Set<Class> stringConvertibleTypes)
                  throws LocalServiceBindingException
Throws:
LocalServiceBindingException

readStringConvertibleTypes

protected Set<Class> readStringConvertibleTypes(Class[] declaredTypes)
                                         throws LocalServiceBindingException
Throws:
LocalServiceBindingException

readStateVariables

protected Map<StateVariable,StateVariableAccessor> readStateVariables(Class<?> clazz,
                                                                      Set<Class> stringConvertibleTypes)
                                                               throws LocalServiceBindingException
Throws:
LocalServiceBindingException

readActions

protected Map<Action,ActionExecutor> readActions(Class<?> clazz,
                                                 Map<StateVariable,StateVariableAccessor> stateVariables,
                                                 Set<Class> stringConvertibleTypes)
                                          throws LocalServiceBindingException
Throws:
LocalServiceBindingException

isActionExcluded

protected boolean isActionExcluded(Action action)
Override this method to exclude action/methods after they have been discovered.



Copyright © 2013 4th Line GmbH, Switzerland. All Rights Reserved.