Package chemaxon.marvin.services
Class ServiceDescriptor
java.lang.Object
chemaxon.marvin.services.ServiceDescriptor
- Direct Known Subclasses:
HTTPServiceDescriptor
,JsonServiceDescriptor
,LocalServiceDescriptor
,SoapServiceDescriptor
,XMLRPCServiceDescriptor
Descriptor class for marvin services
- Since:
- 5.6
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Property key for Service alias asString
static final String
Property key for Arguments as an UnmodifiableList
static final String
Property key for Service description asString
static final String
Property key for Method name to call asString
static final String
Property key for Service name asString
protected PropertyChangeSupport
Property change supportprotected ServiceHandler<? extends ServiceDescriptor>
static final String
Property key for service URL asString
-
Constructor Summary
ModifierConstructorDescriptionprotected
Subclasses must have public argless constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addArgument
(ServiceArgument<?> argument) Adds a new argument to the end of the argument listabstract ServiceHandler<? extends ServiceDescriptor>
Creates a new service handler for this descriptor.getAlias()
Returns the service alias.getArgument
(int index) Returns the type of the specified argumentint
Returns the number of argumentsList<ServiceArgument<?>>
Returns an unmodifiable list of the argument typesReturns the description (tooltip) of service descriptorgetIcon()
Returns the icon of service descriptor ornull
if no iconReturns the method name to callgetName()
Returns the name of the servicegetProperty
(String key) Returns a descriptor propertyReturns the property change support for this objectString[]
Returns the array of property keysServiceHandler<? extends ServiceDescriptor>
Returns the default service handler instance for this descriptor.Returns the simple name of the service typegetURL()
Returns the service URLboolean
Returnstrue
if service is available.removeArgument
(int index) Removes the specified argument from the argument listvoid
Sets the service alias.void
setArgument
(int index, ServiceArgument<?> argument) Replaces the argument at specified index with specified argumentvoid
setDescription
(String description) Sets the description (tooltip) of service descriptorvoid
setMethodName
(String methodName) Sets the method name to callvoid
Sets the name of the servicevoid
setProperty
(String key, String value) Sets a descriptor propertyvoid
Sets the service URLtoString()
-
Field Details
-
NAME
Property key for Service name asString
- See Also:
-
ALIAS
Property key for Service alias asString
- See Also:
-
DESCRIPTION
Property key for Service description asString
- See Also:
-
ARGUMENTS
Property key for Arguments as an UnmodifiableList
- See Also:
-
METHOD
Property key for Method name to call asString
- See Also:
-
URL
Property key for service URL asString
- See Also:
-
propertyChangeSupport
Property change support -
serviceHandler
-
-
Constructor Details
-
ServiceDescriptor
protected ServiceDescriptor()Subclasses must have public argless constructor.
-
-
Method Details
-
setProperty
Sets a descriptor property- Parameters:
key
- the property keyvalue
- the property value
-
getProperty
Returns a descriptor property- Parameters:
key
- the property key- Returns:
- the property value or
null
-
getPropertyKeys
Returns the array of property keys- Returns:
- the array of property keys
-
getName
Returns the name of the service- Returns:
- the name of the service
-
setName
Sets the name of the service- Parameters:
name
- the new service name
-
getAlias
Returns the service alias. Aliases may be used to call services in a user friendly way by parsing user input.- Returns:
- the service alias or
null
if no alias set
-
setAlias
Sets the service alias. Aliases may be used to call services in a user friendly way by parsing user input.- Parameters:
alias
- the new alias
-
getURL
Returns the service URL- Returns:
- the service URL
-
setURL
Sets the service URL- Parameters:
url
- the service URL
-
getMethodName
Returns the method name to call- Returns:
- the method name to call
-
setMethodName
Sets the method name to call- Parameters:
methodName
- the method name
-
getPropertyChangeSupport
Returns the property change support for this object- Returns:
- the property change support for this object
-
getArguments
Returns an unmodifiable list of the argument types- Returns:
- an unmodifiable list of the argument types
-
getArgumentCount
public int getArgumentCount()Returns the number of arguments- Returns:
- the number of arguments
-
getArgument
Returns the type of the specified argument- Parameters:
index
- the index of the argument- Returns:
- the type of index-th argument
-
addArgument
Adds a new argument to the end of the argument list- Parameters:
argument
- the argument
-
setArgument
Replaces the argument at specified index with specified argument- Parameters:
index
- the index of argument to replaceargument
- the new argument
-
removeArgument
Removes the specified argument from the argument list- Parameters:
index
- the index of argument to remove- Returns:
- the removed argument type
-
getIcon
Returns the icon of service descriptor ornull
if no icon- Returns:
- the icon of service descriptor or
null
if no icon
-
setDescription
Sets the description (tooltip) of service descriptor- Parameters:
description
- the new description
-
getDescription
Returns the description (tooltip) of service descriptor- Returns:
- the description (tooltip) of service descriptor
-
getSimpleName
Returns the simple name of the service type- Returns:
- the simple name of the service type
-
toString
-
isAvailable
public boolean isAvailable()Returnstrue
if service is available. Default implementation returnstrue
- Returns:
true
if service is available
-
getServiceHandler
Returns the default service handler instance for this descriptor. The returned handler is capable to perform service call on the service described by this descriptor- Returns:
- a service handler instance for this descriptor
-
createServiceHandler
Creates a new service handler for this descriptor. The returned handler is capable to perform service call on the service described by this descriptor- Returns:
- a service handler instance for this descriptor
-