| |
|
| java.lang.Object com.sun.midp.content.ContentHandlerImpl
All known Subclasses: javax.microedition.content.ContentHandlerServerImpl,
ContentHandlerImpl | public class ContentHandlerImpl implements ContentHandler(Code) | | The internal structure of a registered content handler.
|
Method Summary | |
public int | accessAllowedCount() Gets the number of IDs allowed access by the content handler. | public void | cancelGetRequest() Cancel a pending getRequest . | public static String[] | copy(String[] strings) Checks that all of the string references are non-null
and not zero length. | public static ContentHandler[] | copy(ContentHandler[] handlers) Copy an array of ContentHandlers making a new ContentHandler
for each ContentHandler. | boolean | equals(ContentHandlerImpl other) Compare two ContentHandlerImpl's for equality. | protected boolean | finish(InvocationImpl invoc, int status) Finish this Invocation and set the status for the response.
The finish method may only be called when this
Invocation
has a status of ACTIVE or HOLD .
The content handler may modify the URL, type, action, or
arguments before invoking finish .
If the method
Invocation.getResponseRequired returns
true then the modified
values MUST be returned to the invoking application.
Parameters: invoc - the Invocation to finish Parameters: status - the new status of the Invocation. | public String | getAccessAllowed(int index) Gets the nth ID of an application or content handler
allowed access to this content handler. | public String | getAction(int index) Get the nth action supported by the content handler. | public int | getActionCount() Get the number of actions supported by the content handler. | public ActionNameMap | getActionNameMap() Get the mapping of actions to action names for the current
locale supported by this content handler. | public ActionNameMap | getActionNameMap(String locale) Get the mapping of actions to action names for the requested
locale supported by this content handler.
The locale is matched against the available locales.
If a match is found it is used. | public ActionNameMap | getActionNameMap(int index) Gets the nth ActionNameMap supported by the
content handler. | public int | getActionNameMapCount() Gets the number of action name maps supported by the content handler. | String[] | getActions() Get actions supported by the content handler. | public String | getAppName() Returns the name used to present this content handler to a user. | public String | getAuthority() Gets the name of the authority that authorized this application.
This value MUST be null unless the device has been
able to authenticate this application.
If non-null , it is the string identifiying the
authority. | public String | getID() Get the content handler ID. | public InvocationImpl | getRequest(boolean wait, Invocation invocation) Gets the next Invocation request pending for this
ContentHandlerServer. | public String | getSuffix(int index) Get the nth suffix supported by the content handler. | public int | getSuffixCount() Get the number of suffixes supported by the content handler. | String[] | getSuffixes() Get suffixes supported by the content handler. | public String | getType(int index) Get the nth type supported by the content handler. | public int | getTypeCount() Get the number of types supported by the content handler. | String[] | getTypes() Get types supported by the content handler. | public String | getVersion() Gets the version number of this content handler. | public boolean | hasAction(String action) Determine if a action is supported by the content handler. | public boolean | hasSuffix(String suffix) Determine if a suffix is supported by the content handler. | public boolean | hasType(String type) Determine if a type is supported by the content handler. | public boolean | isAccessAllowed(String ID) Determines if an ID MUST be allowed access by the content handler. | protected void | requestNotify() Notify the request listener of a pending request. | public void | setListener(RequestListener listener) Set the listener to be notified when a new request is
available for this content handler. | public String | toString() Debug routine to print the values. |
ID | String ID(Code) | | The content handler ID.
Lengths up to 256 characters MUST be supported.
The ID may be null .
|
REGISTERED_DYNAMIC | final static int REGISTERED_DYNAMIC(Code) | | Dynamically registered content handler via API
|
REGISTERED_NATIVE | final static int REGISTERED_NATIVE(Code) | | Native platform content handler
|
REGISTERED_STATIC | final static int REGISTERED_STATIC(Code) | | Content handler statically registered during installation
|
ZERO_STRINGS | final public static String[] ZERO_STRINGS(Code) | | Empty String array to return when needed.
|
actionnames | ActionNameMap[] actionnames(Code) | | The action names that are defined by this content handler.
|
appname | String appname(Code) | | The Name from parsing the Property for the MIDlet
with this classname.
|
authority | String authority(Code) | | The authority that authenticated this ContentHandler.
|
classname | String classname(Code) | | The application class name that implements this content
handler. Note: Only the application that registered the class
will see the classname; for other applications the value will be
null .
|
registrationMethod | int registrationMethod(Code) | | Indicates content handler registration method:
dynamic registration from the API, static registration from install
or native content handler.
Must be similar to enum in jsr211_registry.h
|
removed | boolean removed(Code) | | Instance is a registration or unregistration.
An unregistration needs only storageId and classname.
|
seqno | final int seqno(Code) | | The sequence number of this instance; monotonic increasing.
|
storageId | int storageId(Code) | | The MIDlet suite storagename that contains the MIDlet.
|
version | String version(Code) | | The Version parsed from MIDlet-Version attribute.
|
ContentHandlerImpl | ContentHandlerImpl(String[] types, String[] suffixes, String[] actions, ActionNameMap[] actionnames, String ID, String[] accessRestricted, String auth)(Code) | | Construct a ContentHandlerImpl.
Verifies that all strings are non-null
Parameters: types - an array of types to register; may benull Parameters: suffixes - an array of suffixes to register; may benull Parameters: actions - an array of actions to register; may benull Parameters: actionnames - an array of ActionNameMaps to register; may benull Parameters: ID - the content handler ID; may be null Parameters: accessRestricted - the IDs of applications allowed access Parameters: auth - application authority exception: NullPointerException - if any types, suffixes,actions, actionnames array element is null exception: IllegalArgumentException - is thrown if any ofthe types, suffix, or action strings have alength of zero orif the ID has a length of zero or contains anycontrol character or space (U+0000-U+00020) |
ContentHandlerImpl | ContentHandlerImpl()(Code) | | Constructor used to read handlers.
|
accessAllowedCount | public int accessAllowedCount()(Code) | | Gets the number of IDs allowed access by the content handler.
The number of IDs must be equal to the length of the array
of accessRestricted passed to
javax.microedition.content.Registry.register Registry.register .
If the number of IDs is zero then all applications and
content handlers are allowed access.
the number of accessRestricteds |
cancelGetRequest | public void cancelGetRequest()(Code) | | Cancel a pending getRequest .
This method will force a Thread blocked in a call to the
getRequest method for the same application
context to return early.
If no Thread is blocked; this call has no effect.
|
copy | public static String[] copy(String[] strings)(Code) | | Checks that all of the string references are non-null
and not zero length. If either the argument is null or
is an empty array the default ZERO length string array is used.
Parameters: strings - array to check for null and length == 0 a non-null array of strings; an empty array replaces null exception: NullPointerException - if any string ref is null exception: IllegalArgumentException - if any stringhas length == 0 |
copy | public static ContentHandler[] copy(ContentHandler[] handlers)(Code) | | Copy an array of ContentHandlers making a new ContentHandler
for each ContentHandler. Make copies of any mutiple object.
Parameters: handlers - the array of handlers duplicate the new array of content handlers |
equals | boolean equals(ContentHandlerImpl other)(Code) | | Compare two ContentHandlerImpl's for equality.
Classname, storageID, and seqno must match.
Parameters: other - another ContentHandlerImpl true if the other handler is for the same class,storageID, and seqno. |
finish | protected boolean finish(InvocationImpl invoc, int status)(Code) | | Finish this Invocation and set the status for the response.
The finish method may only be called when this
Invocation
has a status of ACTIVE or HOLD .
The content handler may modify the URL, type, action, or
arguments before invoking finish .
If the method
Invocation.getResponseRequired returns
true then the modified
values MUST be returned to the invoking application.
Parameters: invoc - the Invocation to finish Parameters: status - the new status of the Invocation. This MUST be eitherOK or CANCELLED . true if the MIDlet suite MUSTvoluntarily exit before the response can be returned to theinvoking application exception: IllegalArgumentException - if the newstatus of the Invocationis not OK or CANCELLED exception: IllegalStateException - if the currentstatus of theInvocation is not ACTIVE or HOLD exception: NullPointerException - if the invocation is null |
getAction | public String getAction(int index)(Code) | | Get the nth action supported by the content handler.
Parameters: index - the index into the actions the nth action exception: IndexOutOfBounds - if index is less than zero orgreater than or equal to the value of theContentHandlerImpl.getActionCount getActionCount method. |
getActionCount | public int getActionCount()(Code) | | Get the number of actions supported by the content handler.
the number of actions |
getActionNameMap | public ActionNameMap getActionNameMap()(Code) | | Get the mapping of actions to action names for the current
locale supported by this content handler. The behavior is
the same as invoking
ContentHandlerImpl.getActionNameMap with the current
locale.
an ActionNameMap; if there is no map available for thecurrent locale, then it MUST be null |
getActionNameMap | public ActionNameMap getActionNameMap(String locale)(Code) | | Get the mapping of actions to action names for the requested
locale supported by this content handler.
The locale is matched against the available locales.
If a match is found it is used. If an exact match is
not found, then the locale string is shortened and retried
if either of the "_" or "-" delimiters is present.
The locale is shortened by retaining only the characters up to
but not including the last occurence of the delimiter
(either "_" or "-").
The shortening and matching is repeated as long as the string
contains one of the delimiters.
Effectively, this will try the full locale and then try
without the variant or country code, if they were present.
Parameters: locale - for which to find an ActionNameMap;MUST NOT be null an ActionNameMap; if there is no map available for thelocale, then it MUST be null exception: NullPointerException - if the locale is null |
getActionNameMapCount | public int getActionNameMapCount()(Code) | | Gets the number of action name maps supported by the content handler.
the number of action name maps |
getActions | String[] getActions()(Code) | | Get actions supported by the content handler.
array of actions supported |
getAppName | public String getAppName()(Code) | | Returns the name used to present this content handler to a user.
The value is extracted from the normal installation information
about the content handler application.
the user-friendly name of the application;it MUST NOT be null |
getAuthority | public String getAuthority()(Code) | | Gets the name of the authority that authorized this application.
This value MUST be null unless the device has been
able to authenticate this application.
If non-null , it is the string identifiying the
authority. For example,
if the application was a signed MIDlet, then this is the
"subject" of the certificate used to sign the application.
The format of the authority for X.509 certificates is defined
by the MIDP Printable Representation of X.509 Distinguished
Names as defined in class
javax.microedition.pki.Certificate .
the authority; may be null |
getID | public String getID()(Code) | | Get the content handler ID. The ID uniquely identifies the
application which contains the content handler.
After registration and for every registered handler,
the ID MUST NOT be null .
the ID; MUST NOT be null unless theContentHandler is not registered. |
getSuffix | public String getSuffix(int index)(Code) | | Get the nth suffix supported by the content handler.
Parameters: index - the index into the suffixes the nth suffix exception: IndexOutOfBounds - if index is less than zero orgreater than or equal to the value of theContentHandlerImpl.getSuffixCount getSuffixCount method. |
getSuffixCount | public int getSuffixCount()(Code) | | Get the number of suffixes supported by the content handler.
the number of suffixes |
getSuffixes | String[] getSuffixes()(Code) | | Get suffixes supported by the content handler.
array of suffixes supported |
getType | public String getType(int index)(Code) | | Get the nth type supported by the content handler.
Parameters: index - the index into the types the nth type exception: IndexOutOfBounds - if index is less than zero orgreater than or equal to the value of theContentHandlerImpl.getTypeCount getTypeCount method. |
getTypeCount | public int getTypeCount()(Code) | | Get the number of types supported by the content handler.
the number of types |
getTypes | String[] getTypes()(Code) | | Get types supported by the content handler.
array of types supported |
getVersion | public String getVersion()(Code) | | Gets the version number of this content handler.
The value is extracted from the normal installation information
about the content handler application.
the version number of the application;MAY be null |
hasAction | public boolean hasAction(String action)(Code) | | Determine if a action is supported by the content handler.
Parameters: action - the action to check for true if the action is supported;false otherwise exception: NullPointerException - if action is null |
hasSuffix | public boolean hasSuffix(String suffix)(Code) | | Determine if a suffix is supported by the content handler.
Parameters: suffix - the suffix to check for true if the suffix is supported;false otherwise exception: NullPointerException - if suffix is null |
hasType | public boolean hasType(String type)(Code) | | Determine if a type is supported by the content handler.
Parameters: type - the type to check for true if the type is supported;false otherwise exception: NullPointerException - if type is null |
isAccessAllowed | public boolean isAccessAllowed(String ID)(Code) | | Determines if an ID MUST be allowed access by the content handler.
Access MUST be allowed if the ID has a prefix that exactly matches
any of the IDs returned by
ContentHandlerImpl.getAccessAllowed .
The prefix comparison is equivalent to
java.lang.String.startsWith .
Parameters: ID - the ID for which to check access true if access MUST be allowed by thecontent handler;false otherwise exception: NullPointerException - if accessRestricted is null |
requestNotify | protected void requestNotify()(Code) | | Notify the request listener of a pending request.
Overridden by subclass.
|
setListener | public void setListener(RequestListener listener)(Code) | | Set the listener to be notified when a new request is
available for this content handler. The request MUST
be retrieved using
ContentHandlerImpl.getRequest .
Parameters: listener - the listener to register;null to remove the listener. |
toString | public String toString()(Code) | | Debug routine to print the values.
a string with the details |
|
|
|