Class DescriptionImpl
java.lang.Object
org.springframework.extensions.webscripts.AbstractBaseDescription
org.springframework.extensions.webscripts.AbstractBaseDescriptionDocument
org.springframework.extensions.webscripts.DescriptionImpl
- All Implemented Interfaces:
BaseDescription,BaseDescriptionDocument,Description
Implementation of a Web Script Description
- Author:
- davidc
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.extensions.webscripts.Description
Description.FormatStyle, Description.Lifecycle, Description.RequiredAuthentication, Description.RequiredCache, Description.RequiredTransaction, Description.RequiredTransactionParameters, Description.TransactionCapability -
Field Summary
FieldsFields inherited from class org.springframework.extensions.webscripts.AbstractBaseDescriptionDocument
COMMON_XML_HEADER, COMMON_XML_NS, NEW_LINE, TAB -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorDescriptionImpl(String id, String shortName, String description, String url) Constructor with id, shortName, description and url -
Method Summary
Modifier and TypeMethodDescriptionGets webscript argument descriptionsGets the default response format Note: the default response format is the first listed in the service description documentGets web script specific extensionsGets the family(s) of this service in the order that they are definedGets the style of Format discriminator supported by this web scriptgetKind()Gets the kind of service.Get the lifecycleGets the HTTP method this service is bound tobooleanGets the formats available for negotiationGets the package (Path version of getScriptPath)Gets webscript request typesGets the required authentication level for execution of this serviceGets the required level of cachingGets the required transaction levelGets the transaction parametersGets webscript response typesgetRunAs()Gets the ID of the user that the service should be run as ornullif the service is to be run as the authenticated user.Gets the path within the store of this web scriptString[]getURIs()Gets the URIs this service supportsstatic DescriptionImplReturn a new instance of webscriptvoidparse(org.dom4j.Element elem) Populates fields from given XML element without validationvoidsetArguments(ArgumentTypeDescription[] arguments) voidsetDefaultFormat(String defaultFormat) Sets the default response formatvoidsetExtensions(Map<String, Serializable> extensions) Sets Web Script custom extensionsvoidsetFamilys(Set<String> familys) voidsetFormatStyle(Description.FormatStyle formatStyle) Sets the format stylevoidSets the service kindvoidsetLifecycle(Description.Lifecycle lifecycle) Sets the lifecyclevoidSets the service http methodvoidsetMultipartProcessing(boolean multipartProcessing) voidsetNegotiatedFormats(NegotiatedFormat[] negotiatedFormats) Sets the negotiated formatsvoidsetPackage(Path scriptPackage) Sets the Package (path version of getScriptPath)voidsetRequestTypes(TypeDescription[] requestTypes) voidsetRequiredAuthentication(Description.RequiredAuthentication requiredAuthentication) Sets the required level of authenticationvoidsetRequiredCache(Description.RequiredCache requiredCache) Sets the required cachevoidsetRequiredTransactionParameters(Description.RequiredTransactionParameters transactionParameters) Sets the transaction parametersvoidsetResponseTypes(TypeDescription[] responseTypes) voidSets the ID of the user that the service should be run as.voidsetScriptPath(String scriptPath) Sets the script pathvoidSets the service URIstoString()Methods inherited from class org.springframework.extensions.webscripts.AbstractBaseDescriptionDocument
getDescDocument, getDescPath, getStore, getStorePath, parseDocument, setDescPath, setStoreMethods inherited from class org.springframework.extensions.webscripts.AbstractBaseDescription
compareField, getDescription, getId, getShortName, setDescription, setId, setShortName, validateRootElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.extensions.webscripts.BaseDescription
getDescription, getId, getShortNameMethods inherited from interface org.springframework.extensions.webscripts.Description
getDescDocument, getDescPath, getStorePath
-
Field Details
-
ROOT_ELEMENT_NAME
- See Also:
-
DESC_NAME_POSTFIX
- See Also:
-
DESC_NAME_PATTERN
- See Also:
-
-
Constructor Details
-
DescriptionImpl
Constructor with id, shortName, description and url- Parameters:
id- StringshortName- Stringdescription- Stringurl- String
-
DescriptionImpl
public DescriptionImpl()Default constructor
-
-
Method Details
-
getArguments
Description copied from interface:DescriptionGets webscript argument descriptions- Specified by:
getArgumentsin interfaceDescription- Returns:
- the arguments
-
setArguments
- Parameters:
arguments- the arguments to set
-
getRequestTypes
Description copied from interface:DescriptionGets webscript request types- Specified by:
getRequestTypesin interfaceDescription- Returns:
- the requestTypes
-
setRequestTypes
- Parameters:
requestTypes- the requestTypes to set
-
getResponseTypes
Description copied from interface:DescriptionGets webscript response types- Specified by:
getResponseTypesin interfaceDescription- Returns:
- the responseTypes
-
setResponseTypes
- Parameters:
responseTypes- the responseTypes to set
-
setScriptPath
Sets the script path- Parameters:
scriptPath- String
-
getScriptPath
Description copied from interface:DescriptionGets the path within the store of this web script- Specified by:
getScriptPathin interfaceDescription- Returns:
- path within store
-
setPackage
Sets the Package (path version of getScriptPath)- Parameters:
scriptPackage- Path
-
getPackage
Description copied from interface:DescriptionGets the package (Path version of getScriptPath)- Specified by:
getPackagein interfaceDescription
-
setKind
Sets the service kind- Parameters:
kind- String
-
getKind
Description copied from interface:DescriptionGets the kind of service. A Web Script may explicitly define its backing-bean implementation. The backing bean implementation is identified by a Spring bean whose id is: webscript.The may be dot separated. - Specified by:
getKindin interfaceDescription- Returns:
- the kind of service (or null, for a vanilla declarative web script)
-
setFamilys
- Parameters:
familys- the family to set
-
getFamilys
Description copied from interface:DescriptionGets the family(s) of this service in the order that they are defined- Specified by:
getFamilysin interfaceDescription
-
setRequiredAuthentication
Sets the required level of authentication- Parameters:
requiredAuthentication- RequiredAuthentication
-
getRequiredAuthentication
Description copied from interface:DescriptionGets the required authentication level for execution of this service- Specified by:
getRequiredAuthenticationin interfaceDescription- Returns:
- the required authentication level
-
setRunAs
Sets the ID of the user that the service should be run as. If not set, the service run as the authenticated user.- Parameters:
runAs- a user name
-
getRunAs
Description copied from interface:DescriptionGets the ID of the user that the service should be run as ornullif the service is to be run as the authenticated user.- Specified by:
getRunAsin interfaceDescription- Returns:
- a user name or
nullif not applicable
-
getRequiredTransaction
Description copied from interface:DescriptionGets the required transaction level- Specified by:
getRequiredTransactionin interfaceDescription- Returns:
- the required transaction level
-
setRequiredTransactionParameters
public void setRequiredTransactionParameters(Description.RequiredTransactionParameters transactionParameters) Sets the transaction parameters- Parameters:
transactionParameters- RequiredTransactionParameters
-
getRequiredTransactionParameters
Description copied from interface:DescriptionGets the transaction parameters- Specified by:
getRequiredTransactionParametersin interfaceDescription- Returns:
- the transaction parameters
-
setRequiredCache
Sets the required cache- Parameters:
requiredCache- RequiredCache
-
getRequiredCache
Description copied from interface:DescriptionGets the required level of caching- Specified by:
getRequiredCachein interfaceDescription- Returns:
- RequiredCache
-
setFormatStyle
Sets the format style- Parameters:
formatStyle- FormatStyle
-
getFormatStyle
Description copied from interface:DescriptionGets the style of Format discriminator supported by this web script- Specified by:
getFormatStylein interfaceDescription- Returns:
- format style
-
setMethod
Sets the service http method- Parameters:
httpMethod- String
-
getMethod
Description copied from interface:DescriptionGets the HTTP method this service is bound to- Specified by:
getMethodin interfaceDescription- Returns:
- HTTP method
-
setUris
Sets the service URIs- Parameters:
uris- String[]
-
getURIs
Description copied from interface:DescriptionGets the URIs this service supports- Specified by:
getURIsin interfaceDescription- Returns:
- array of URIs in order specified in service description document
-
setDefaultFormat
Sets the default response format- Parameters:
defaultFormat- String
-
getDefaultFormat
Description copied from interface:DescriptionGets the default response format Note: the default response format is the first listed in the service description document- Specified by:
getDefaultFormatin interfaceDescription- Returns:
- default response format (or null, if format not known until run-time)
-
setNegotiatedFormats
Sets the negotiated formats- Parameters:
negotiatedFormats- NegotiatedFormat[]
-
getNegotiatedFormats
Description copied from interface:DescriptionGets the formats available for negotiation- Specified by:
getNegotiatedFormatsin interfaceDescription- Returns:
- negotiated formats
-
setExtensions
Sets Web Script custom extensions- Parameters:
extensions- Map<String, Serializable>
-
getExtensions
Description copied from interface:DescriptionGets web script specific extensions- Specified by:
getExtensionsin interfaceDescription- Returns:
- map of extensions by name
-
getLifecycle
Description copied from interface:DescriptionGet the lifecycle- Specified by:
getLifecyclein interfaceDescription
-
setLifecycle
Sets the lifecycle- Parameters:
lifecycle- Lifecycle
-
getMultipartProcessing
public boolean getMultipartProcessing()- Specified by:
getMultipartProcessingin interfaceDescription- Returns:
- true if automatic multipart formdata processes is enabled
-
setMultipartProcessing
public void setMultipartProcessing(boolean multipartProcessing) - Specified by:
setMultipartProcessingin interfaceDescription- Parameters:
multipartProcessing- the multipartProcessing to set
-
parse
public void parse(org.dom4j.Element elem) Description copied from class:AbstractBaseDescriptionPopulates fields from given XML element without validation- Overrides:
parsein classAbstractBaseDescription- Parameters:
elem- root element for parsing
-
toString
-
newInstance
Return a new instance of webscript- Returns:
- a new instance of webscript
-