Package org.astrogrid.samp
Class Metadata
- java.lang.Object
-
- java.util.AbstractMap
-
- org.astrogrid.samp.SampMap
-
- org.astrogrid.samp.Metadata
-
- All Implemented Interfaces:
java.util.Map
public class Metadata extends SampMap
Represents the application metadata associated with a SAMP client.- Since:
- 14 Jul 2008
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDESCHTML_KEYKey for description of the application in HTML.static java.lang.StringDESCTEXT_KEYKey for short description of the application in plain text.static java.lang.StringDOCURL_KEYKey for the URL of a documentation web page.static java.lang.StringICONURL_KEYKey for the URL of an icon in png, gif or jpeg format.static java.lang.StringNAME_KEYKey for application name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MetadataasMetadata(java.util.Map map)Returns a given map as a Metadata object.voidcheck()Checks that this object is ready for use with the SAMP toolkit.java.lang.StringgetDescriptionHtml()Returns an HTML description of the application.java.lang.StringgetDescriptionText()Returns a short description of the application.java.net.URLgetDocumentationUrl()Returns a URL for a documentation web page.java.net.URLgetIconUrl()Returns a URL for a gif, png or jpeg icon identifying the application.java.lang.StringgetName()Returns the value for the application's name.voidsetDescriptionHtml(java.lang.String html)Sets an HTML description of the application.voidsetDescriptionText(java.lang.String txt)Sets a short description of the application.voidsetDocumentationUrl(java.lang.String url)Sets a URL for a documentation web page.voidsetIconUrl(java.lang.String url)Sets a URL for a gif, png or jpeg icon identifying the application.voidsetName(java.lang.String name)Sets the value for the application's name.-
Methods inherited from class org.astrogrid.samp.SampMap
checkHasKeys, entrySet, getList, getMap, getString, getUrl, put
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
-
-
-
-
Field Detail
-
NAME_KEY
public static final java.lang.String NAME_KEY
Key for application name.- See Also:
- Constant Field Values
-
DESCTEXT_KEY
public static final java.lang.String DESCTEXT_KEY
Key for short description of the application in plain text.- See Also:
- Constant Field Values
-
DESCHTML_KEY
public static final java.lang.String DESCHTML_KEY
Key for description of the application in HTML.- See Also:
- Constant Field Values
-
ICONURL_KEY
public static final java.lang.String ICONURL_KEY
Key for the URL of an icon in png, gif or jpeg format.- See Also:
- Constant Field Values
-
DOCURL_KEY
public static final java.lang.String DOCURL_KEY
Key for the URL of a documentation web page.- See Also:
- Constant Field Values
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Sets the value for the application's name.- Parameters:
name- value forNAME_KEYkey
-
getName
public java.lang.String getName()
Returns the value for the application's name.- Returns:
- value for
NAME_KEYkey
-
setDescriptionText
public void setDescriptionText(java.lang.String txt)
Sets a short description of the application.- Parameters:
txt- value forDESCTEXT_KEYkey
-
getDescriptionText
public java.lang.String getDescriptionText()
Returns a short description of the application.- Returns:
- value for
DESCTEXT_KEYkey
-
setDescriptionHtml
public void setDescriptionHtml(java.lang.String html)
Sets an HTML description of the application.- Parameters:
html- value forDESCHTML_KEYkey
-
getDescriptionHtml
public java.lang.String getDescriptionHtml()
Returns an HTML description of the application.- Returns:
- value for
DESCHTML_KEYkey
-
setIconUrl
public void setIconUrl(java.lang.String url)
Sets a URL for a gif, png or jpeg icon identifying the application.- Parameters:
url- value forICONURL_KEYkey
-
getIconUrl
public java.net.URL getIconUrl()
Returns a URL for a gif, png or jpeg icon identifying the application.- Returns:
- value for
ICONURL_KEYkey
-
setDocumentationUrl
public void setDocumentationUrl(java.lang.String url)
Sets a URL for a documentation web page.- Parameters:
url- value forDOCURL_KEYkey
-
getDocumentationUrl
public java.net.URL getDocumentationUrl()
Returns a URL for a documentation web page.- Returns:
- value for
DOCURL_KEYkey
-
check
public void check()
Description copied from class:SampMapChecks that this object is ready for use with the SAMP toolkit. As well as callingSampUtils.checkMap(java.util.Map)(ensuring that all keys are Strings, and all values Strings, Lists or Maps), subclass-specific invariants may be checked. In the case that there's something wrong, an informativeDataExceptionwill be thrown.
-
asMetadata
public static Metadata asMetadata(java.util.Map map)
Returns a given map as a Metadata object.- Parameters:
map- map- Returns:
- metadata
-
-