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
FieldsModifier and TypeFieldDescriptionstatic final StringProperty key for Service alias asStringstatic final StringProperty key for Arguments as an UnmodifiableListstatic final StringProperty key for Service description asStringstatic final StringProperty key for Method name to call asStringstatic final StringProperty key for Service name asStringprotected PropertyChangeSupportProperty change supportprotected ServiceHandler<? extends ServiceDescriptor> static final StringProperty key for service URL asString -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSubclasses must have public argless constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(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 argumentintReturns 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 ornullif 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 URLbooleanReturnstrueif service is available.removeArgument(int index) Removes the specified argument from the argument listvoidSets the service alias.voidsetArgument(int index, ServiceArgument<?> argument) Replaces the argument at specified index with specified argumentvoidsetDescription(String description) Sets the description (tooltip) of service descriptorvoidsetMethodName(String methodName) Sets the method name to callvoidSets the name of the servicevoidsetProperty(String key, String value) Sets a descriptor propertyvoidSets 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
nullif 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 ornullif no icon- Returns:
- the icon of service descriptor or
nullif 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()Returnstrueif service is available. Default implementation returnstrue- Returns:
trueif 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
-