Java Doc for Plugin.java in  » 6.0-JDK-Modules » jaxb-xjc » com » sun » tools » xjc » 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 » jaxb xjc » com.sun.tools.xjc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.tools.xjc.Plugin

All known Subclasses:   com.sun.tools.xjc.addon.locator.SourceLocationAddOn,  com.sun.tools.xjc.addon.code_injector.PluginImpl,  com.sun.tools.xjc.addon.at_generated.PluginImpl,  com.sun.tools.xjc.addon.episode.PluginImpl,  com.sun.tools.xjc.addon.sync.SynchronizedMethodAddOn,
Plugin
abstract public class Plugin (Code)
Add-on that works on the generated source code.

This add-on will be called after the default bean generation has finished.
author:
   Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
since:
   JAXB RI 2.0 EA





Method Summary
public  List<String>getCustomizationURIs()
     Returns the list of namespace URIs that are supported by this plug-in as schema annotations.

If a plug-in returns a non-empty list, the JAXB RI will recognize these namespace URIs as vendor extensions (much like "http://java.sun.com/xml/ns/jaxb/xjc").

abstract public  StringgetOptionName()
     Gets the option name to turn on this add-on.

For example, if "abc" is returned, "-abc" will turn on this plugin.

abstract public  StringgetUsage()
     Gets the description of this add-on.
public  booleanisCustomizationTagName(String nsUri, String localName)
     Checks if the given tag name is a valid tag name for the customization element in this plug-in.

This method is invoked by XJC to determine if the user-specified customization element is really a customization or not.

public  voidonActivated(Options opts)
     Notifies a plugin that it's activated.
public  intparseArgument(Options opt, String[] args, int i)
     Parses an option args[i] and augment the opt object appropriately, then return the number of tokens consumed.

The callee doesn't need to recognize the option that the getOptionName method returns.

Once a plugin is activated, this method is called for options that XJC didn't recognize.

public  voidpostProcessModel(Model model, ErrorHandler errorHandler)
     Performs the post-processing of the Model .

This method is invoked after XJC has internally finished the model construction.

abstract public  booleanrun(Outline outline, Options opt, ErrorHandler errorHandler)
     Run the add-on.

This method is invoked after XJC has internally finished the code generation.




Method Detail
getCustomizationURIs
public List<String> getCustomizationURIs()(Code)
Returns the list of namespace URIs that are supported by this plug-in as schema annotations.

If a plug-in returns a non-empty list, the JAXB RI will recognize these namespace URIs as vendor extensions (much like "http://java.sun.com/xml/ns/jaxb/xjc"). This allows users to write those annotations inside a schema, or in external binding files, and later plug-ins can access those annotations as DOM nodes.

See http://java.sun.com/webservices/docs/1.5/jaxb/vendorCustomizations.html for the syntax that users need to use to enable extension URIs. can be empty, be never be null.




getOptionName
abstract public String getOptionName()(Code)
Gets the option name to turn on this add-on.

For example, if "abc" is returned, "-abc" will turn on this plugin. A plugin needs to be turned on explicitly, or else no other methods of Plugin will be invoked.

Starting 2.1, when an option matches the name returned from this method, XJC will then invoke Plugin.parseArgument(Options,String[],int) , allowing plugins to handle arguments to this option.




getUsage
abstract public String getUsage()(Code)
Gets the description of this add-on. Used to generate a usage screen. localized description message. should be terminated by \n.



isCustomizationTagName
public boolean isCustomizationTagName(String nsUri, String localName)(Code)
Checks if the given tag name is a valid tag name for the customization element in this plug-in.

This method is invoked by XJC to determine if the user-specified customization element is really a customization or not. This information is used to pick the proper error message.

A plug-in is still encouraged to do the validation of the customization element in the Plugin.run method before using any CPluginCustomization , to make sure that it has proper child elements and attributes.
Parameters:
  nsUri - the namespace URI of the element. Never null.
Parameters:
  localName - the local name of the element. Never null.




onActivated
public void onActivated(Options opts) throws BadCommandLineException(Code)
Notifies a plugin that it's activated.

This method is called when a plugin is activated through the command line option (as specified by Plugin.getOptionName() .

This is a good opportunity to use Options.setFieldRendererFactory(FieldRendererFactoryPlugin) if a plugin so desires.

Noop by default.
since:
   JAXB 2.0 EA4




parseArgument
public int parseArgument(Options opt, String[] args, int i) throws BadCommandLineException, IOException(Code)
Parses an option args[i] and augment the opt object appropriately, then return the number of tokens consumed.

The callee doesn't need to recognize the option that the getOptionName method returns.

Once a plugin is activated, this method is called for options that XJC didn't recognize. This allows a plugin to define additional options to customize its behavior.

Since options can appear in no particular order, XJC allows sub-options of a plugin to show up before the option that activates a plugin (one that's returned by #getOptionName().) But nevertheless a Plugin needs to be activated to participate in further processing. 0 if the argument is not understood.Otherwise return the number of tokens that areconsumed, including the option itself.(so if you have an option like "-foo 3", return 2.)
exception:
  BadCommandLineException - If the option was recognized but there's an error.This halts the argument parsing process and causesXJC to abort, reporting an error.




postProcessModel
public void postProcessModel(Model model, ErrorHandler errorHandler)(Code)
Performs the post-processing of the Model .

This method is invoked after XJC has internally finished the model construction. This is a chance for a plugin to affect the way code generation is performed.

Compared to the Plugin.run(Outline,Options,ErrorHandler) method, this method allows a plugin to work at the higher level conceptually closer to the abstract JAXB model, as opposed to Java syntax level.

Note that this method is invoked only when a Plugin is activated.
Parameters:
  model - The object that represents the classes/properties tobe generated.
Parameters:
  errorHandler - Errors should be reported to this handler.
since:
   JAXB 2.0.2




run
abstract public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) throws SAXException(Code)
Run the add-on.

This method is invoked after XJC has internally finished the code generation. Plugins can tweak some of the generated code (or add more code) by using Outline and Options .

Note that this method is invoked only when a Plugin is activated.
Parameters:
  outline - This object allows access to various generated code.
Parameters:
  errorHandler - Errors should be reported to this handler.If the add-on executes successfully, return true.If it detects some errors but those are reported andrecovered gracefully, return false.
throws:
  SAXException - After an error is reported to ErrorHandler, thesame exception can be thrown to indicate a fatal irrecoverableerror. ErrorHandler itself may throw it, if it choosesnot to recover from the error.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.