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
public class DescriptionImpl extends AbstractBaseDescriptionDocument implements 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
Fields Modifier and Type Field Description static java.lang.StringDESC_NAME_PATTERNstatic java.lang.StringDESC_NAME_POSTFIXstatic java.lang.StringROOT_ELEMENT_NAME-
Fields inherited from class org.springframework.extensions.webscripts.AbstractBaseDescriptionDocument
COMMON_XML_HEADER, COMMON_XML_NS, NEW_LINE, TAB
-
-
Constructor Summary
Constructors Constructor Description DescriptionImpl()Default constructorDescriptionImpl(java.lang.String id, java.lang.String shortName, java.lang.String description, java.lang.String url)Constructor with id, shortName, description and url
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ArgumentTypeDescription[]getArguments()Gets webscript argument descriptionsjava.lang.StringgetDefaultFormat()Gets the default response format Note: the default response format is the first listed in the service description documentjava.util.Map<java.lang.String,java.io.Serializable>getExtensions()Gets web script specific extensionsjava.util.Set<java.lang.String>getFamilys()Gets the family(s) of this service in the order that they are definedDescription.FormatStylegetFormatStyle()Gets the style of Format discriminator supported by this web scriptjava.lang.StringgetKind()Gets the kind of service.Description.LifecyclegetLifecycle()Get the lifecyclejava.lang.StringgetMethod()Gets the HTTP method this service is bound tobooleangetMultipartProcessing()NegotiatedFormat[]getNegotiatedFormats()Gets the formats available for negotiationPathgetPackage()Gets the package (Path version of getScriptPath)TypeDescription[]getRequestTypes()Gets webscript request typesDescription.RequiredAuthenticationgetRequiredAuthentication()Gets the required authentication level for execution of this serviceDescription.RequiredCachegetRequiredCache()Gets the required level of cachingDescription.RequiredTransactiongetRequiredTransaction()Gets the required transaction levelDescription.RequiredTransactionParametersgetRequiredTransactionParameters()Gets the transaction parametersTypeDescription[]getResponseTypes()Gets webscript response typesjava.lang.StringgetRunAs()Gets the ID of the user that the service should be run as ornullif the service is to be run as the authenticated user.java.lang.StringgetScriptPath()Gets the path within the store of this web scriptjava.lang.String[]getURIs()Gets the URIs this service supportsstatic DescriptionImplnewInstance()Return a new instance of webscriptvoidparse(org.dom4j.Element elem)Populates fields from given XML element without validationvoidsetArguments(ArgumentTypeDescription[] arguments)voidsetDefaultFormat(java.lang.String defaultFormat)Sets the default response formatvoidsetExtensions(java.util.Map<java.lang.String,java.io.Serializable> extensions)Sets Web Script custom extensionsvoidsetFamilys(java.util.Set<java.lang.String> familys)voidsetFormatStyle(Description.FormatStyle formatStyle)Sets the format stylevoidsetKind(java.lang.String kind)Sets the service kindvoidsetLifecycle(Description.Lifecycle lifecycle)Sets the lifecyclevoidsetMethod(java.lang.String httpMethod)Sets 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)voidsetRunAs(java.lang.String runAs)Sets the ID of the user that the service should be run as.voidsetScriptPath(java.lang.String scriptPath)Sets the script pathvoidsetUris(java.lang.String[] uris)Sets the service URIsjava.lang.StringtoString()-
Methods inherited from class org.springframework.extensions.webscripts.AbstractBaseDescriptionDocument
getDescDocument, getDescPath, getStore, getStorePath, parseDocument, setDescPath, setStore
-
Methods inherited from class org.springframework.extensions.webscripts.AbstractBaseDescription
compareField, getDescription, getId, getShortName, setDescription, setId, setShortName, validateRootElement
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.springframework.extensions.webscripts.BaseDescription
getDescription, getId, getShortName
-
Methods inherited from interface org.springframework.extensions.webscripts.Description
getDescDocument, getDescPath, getStorePath
-
-
-
-
Field Detail
-
ROOT_ELEMENT_NAME
public static final java.lang.String ROOT_ELEMENT_NAME
- See Also:
- Constant Field Values
-
DESC_NAME_POSTFIX
public static final java.lang.String DESC_NAME_POSTFIX
- See Also:
- Constant Field Values
-
DESC_NAME_PATTERN
public static final java.lang.String DESC_NAME_PATTERN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DescriptionImpl
public DescriptionImpl(java.lang.String id, java.lang.String shortName, java.lang.String description, java.lang.String url)Constructor with id, shortName, description and url- Parameters:
id- StringshortName- Stringdescription- Stringurl- String
-
DescriptionImpl
public DescriptionImpl()
Default constructor
-
-
Method Detail
-
getArguments
public ArgumentTypeDescription[] getArguments()
Description copied from interface:DescriptionGets webscript argument descriptions- Specified by:
getArgumentsin interfaceDescription- Returns:
- the arguments
-
setArguments
public void setArguments(ArgumentTypeDescription[] arguments)
- Parameters:
arguments- the arguments to set
-
getRequestTypes
public TypeDescription[] getRequestTypes()
Description copied from interface:DescriptionGets webscript request types- Specified by:
getRequestTypesin interfaceDescription- Returns:
- the requestTypes
-
setRequestTypes
public void setRequestTypes(TypeDescription[] requestTypes)
- Parameters:
requestTypes- the requestTypes to set
-
getResponseTypes
public TypeDescription[] getResponseTypes()
Description copied from interface:DescriptionGets webscript response types- Specified by:
getResponseTypesin interfaceDescription- Returns:
- the responseTypes
-
setResponseTypes
public void setResponseTypes(TypeDescription[] responseTypes)
- Parameters:
responseTypes- the responseTypes to set
-
setScriptPath
public void setScriptPath(java.lang.String scriptPath)
Sets the script path- Parameters:
scriptPath- String
-
getScriptPath
public java.lang.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
public void setPackage(Path scriptPackage)
Sets the Package (path version of getScriptPath)- Parameters:
scriptPackage- Path
-
getPackage
public Path getPackage()
Description copied from interface:DescriptionGets the package (Path version of getScriptPath)- Specified by:
getPackagein interfaceDescription
-
setKind
public void setKind(java.lang.String kind)
Sets the service kind- Parameters:
kind- String
-
getKind
public java.lang.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
public void setFamilys(java.util.Set<java.lang.String> familys)
- Parameters:
familys- the family to set
-
getFamilys
public java.util.Set<java.lang.String> getFamilys()
Description copied from interface:DescriptionGets the family(s) of this service in the order that they are defined- Specified by:
getFamilysin interfaceDescription
-
setRequiredAuthentication
public void setRequiredAuthentication(Description.RequiredAuthentication requiredAuthentication)
Sets the required level of authentication- Parameters:
requiredAuthentication- RequiredAuthentication
-
getRequiredAuthentication
public Description.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
public void setRunAs(java.lang.String runAs)
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
public java.lang.String 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
public Description.RequiredTransaction 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
public Description.RequiredTransactionParameters getRequiredTransactionParameters()
Description copied from interface:DescriptionGets the transaction parameters- Specified by:
getRequiredTransactionParametersin interfaceDescription- Returns:
- the transaction parameters
-
setRequiredCache
public void setRequiredCache(Description.RequiredCache requiredCache)
Sets the required cache- Parameters:
requiredCache- RequiredCache
-
getRequiredCache
public Description.RequiredCache getRequiredCache()
Description copied from interface:DescriptionGets the required level of caching- Specified by:
getRequiredCachein interfaceDescription- Returns:
- RequiredCache
-
setFormatStyle
public void setFormatStyle(Description.FormatStyle formatStyle)
Sets the format style- Parameters:
formatStyle- FormatStyle
-
getFormatStyle
public Description.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
public void setMethod(java.lang.String httpMethod)
Sets the service http method- Parameters:
httpMethod- String
-
getMethod
public java.lang.String getMethod()
Description copied from interface:DescriptionGets the HTTP method this service is bound to- Specified by:
getMethodin interfaceDescription- Returns:
- HTTP method
-
setUris
public void setUris(java.lang.String[] uris)
Sets the service URIs- Parameters:
uris- String[]
-
getURIs
public java.lang.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
public void setDefaultFormat(java.lang.String defaultFormat)
Sets the default response format- Parameters:
defaultFormat- String
-
getDefaultFormat
public java.lang.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
public void setNegotiatedFormats(NegotiatedFormat[] negotiatedFormats)
Sets the negotiated formats- Parameters:
negotiatedFormats- NegotiatedFormat[]
-
getNegotiatedFormats
public NegotiatedFormat[] getNegotiatedFormats()
Description copied from interface:DescriptionGets the formats available for negotiation- Specified by:
getNegotiatedFormatsin interfaceDescription- Returns:
- negotiated formats
-
setExtensions
public void setExtensions(java.util.Map<java.lang.String,java.io.Serializable> extensions)
Sets Web Script custom extensions- Parameters:
extensions- Map
-
getExtensions
public java.util.Map<java.lang.String,java.io.Serializable> getExtensions()
Description copied from interface:DescriptionGets web script specific extensions- Specified by:
getExtensionsin interfaceDescription- Returns:
- map of extensions by name
-
getLifecycle
public Description.Lifecycle getLifecycle()
Description copied from interface:DescriptionGet the lifecycle- Specified by:
getLifecyclein interfaceDescription
-
setLifecycle
public void setLifecycle(Description.Lifecycle lifecycle)
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
newInstance
public static DescriptionImpl newInstance()
Return a new instance of webscript- Returns:
- a new instance of webscript
-
-