Java Doc for ContentHandlerImpl.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » content » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.midp.content 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.


Field Summary
 StringID
     The content handler ID.
final static  intREGISTERED_DYNAMIC
    
final static  intREGISTERED_NATIVE
    
final static  intREGISTERED_STATIC
    
final public static  String[]ZERO_STRINGS
     Empty String array to return when needed.
 ActionNameMap[]actionnames
     The action names that are defined by this content handler.
 Stringappname
     The Name from parsing the Property for the MIDlet with this classname.
 Stringauthority
     The authority that authenticated this ContentHandler.
 Stringclassname
     The application class name that implements this content handler.
 RequestListenerImpllistenerImpl
     The RequestListenerImpl; if a listener is set.
 intregistrationMethod
     Indicates content handler registration method: dynamic registration from the API, static registration from install or native content handler.
 booleanremoved
     Instance is a registration or unregistration.
 intrequestCalls
     Count of requests retrieved via ContentHandlerImpl.getRequest .
final  intseqno
     The sequence number of this instance; monotonic increasing.
 intstorageId
     The MIDlet suite storagename that contains the MIDlet.
 Stringversion
     The Version parsed from MIDlet-Version attribute.

Constructor Summary
 ContentHandlerImpl(String[] types, String[] suffixes, String[] actions, ActionNameMap[] actionnames, String ID, String[] accessRestricted, String auth)
     Construct a ContentHandlerImpl.
protected  ContentHandlerImpl(ContentHandlerImpl handler)
     Initialize a new instance with the same information.
 ContentHandlerImpl()
     Constructor used to read handlers.

Method Summary
public  intaccessAllowedCount()
     Gets the number of IDs allowed access by the content handler.
public  voidcancelGetRequest()
     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.
 booleanequals(ContentHandlerImpl other)
     Compare two ContentHandlerImpl's for equality.
protected  booleanfinish(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  StringgetAccessAllowed(int index)
     Gets the nth ID of an application or content handler allowed access to this content handler.
public  StringgetAction(int index)
     Get the nth action supported by the content handler.
public  intgetActionCount()
     Get the number of actions supported by the content handler.
public  ActionNameMapgetActionNameMap()
     Get the mapping of actions to action names for the current locale supported by this content handler.
public  ActionNameMapgetActionNameMap(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  ActionNameMapgetActionNameMap(int index)
     Gets the nth ActionNameMap supported by the content handler.
public  intgetActionNameMapCount()
     Gets the number of action name maps supported by the content handler.
 String[]getActions()
     Get actions supported by the content handler.
public  StringgetAppName()
     Returns the name used to present this content handler to a user.
public  StringgetAuthority()
     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  StringgetID()
     Get the content handler ID.
public  InvocationImplgetRequest(boolean wait, Invocation invocation)
     Gets the next Invocation request pending for this ContentHandlerServer.
public  StringgetSuffix(int index)
     Get the nth suffix supported by the content handler.
public  intgetSuffixCount()
     Get the number of suffixes supported by the content handler.
 String[]getSuffixes()
     Get suffixes supported by the content handler.
public  StringgetType(int index)
     Get the nth type supported by the content handler.
public  intgetTypeCount()
     Get the number of types supported by the content handler.
 String[]getTypes()
     Get types supported by the content handler.
public  StringgetVersion()
     Gets the version number of this content handler.
public  booleanhasAction(String action)
     Determine if a action is supported by the content handler.
public  booleanhasSuffix(String suffix)
     Determine if a suffix is supported by the content handler.
public  booleanhasType(String type)
     Determine if a type is supported by the content handler.
public  booleanisAccessAllowed(String ID)
     Determines if an ID MUST be allowed access by the content handler.
protected  voidrequestNotify()
     Notify the request listener of a pending request.
public  voidsetListener(RequestListener listener)
     Set the listener to be notified when a new request is available for this content handler.
public  StringtoString()
     Debug routine to print the values.

Field Detail
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.



listenerImpl
RequestListenerImpl listenerImpl(Code)
The RequestListenerImpl; if a listener is set.



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.



requestCalls
int requestCalls(Code)
Count of requests retrieved via ContentHandlerImpl.getRequest .



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.




Constructor Detail
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
protected ContentHandlerImpl(ContentHandlerImpl handler)(Code)
Initialize a new instance with the same information.
Parameters:
  handler - another ContentHandlerImpl
See Also:   javax.microedition.content.ContentHandlerServerImpl



ContentHandlerImpl
ContentHandlerImpl()(Code)
Constructor used to read handlers.




Method Detail
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




getAccessAllowed
public String getAccessAllowed(int index)(Code)
Gets the nth ID of an application or content handler allowed access to this content handler. The ID returned for each index must be the equal to the ID at the same index in the accessAllowed array passed to javax.microedition.content.Registry.register Registry.register .
Parameters:
  index - the index of the ID the nth ID
exception:
  IndexOutOfBoundsException - if index is less than zero orgreater than or equal to the value of theContentHandlerImpl.accessAllowedCount accessAllowedCount method.



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



getActionNameMap
public ActionNameMap getActionNameMap(int index)(Code)
Gets the nth ActionNameMap supported by the content handler.
Parameters:
  index - the index of the locale the nth ActionNameMap
exception:
  IndexOutOfBoundsException - if index is less than zero orgreater than or equal to the value of theContentHandlerImpl.getActionNameMapCount getActionNameMapCount method.



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.



getRequest
public InvocationImpl getRequest(boolean wait, Invocation invocation)(Code)
Gets the next Invocation request pending for this ContentHandlerServer. The method can be unblocked with a call to ContentHandlerImpl.cancelGetRequest cancelGetRequest . The application should process the Invocation as a request to perform the action on the content.
Parameters:
  wait - true if the method must wait forfor an Invocation if one is not available;false if the method MUST NOT wait.
Parameters:
  invocation - an Invocation instance that will delegate tothe result; if any the next pending Invocation or nullif no Invocation is available; nullif cancelled with ContentHandlerImpl.cancelGetRequest cancelGetRequest
See Also:   javax.microedition.content.Registry.invoke
See Also:   javax.microedition.content.ContentHandlerServer.finish



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 actionis 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 suffixis 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 typeis 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 accessRestrictedis 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



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.