atomGenerator = element atom:generator { atomCommonAttributes, attribute uri { atomUri }?, attribute version { text }?, text }
@author Alejandro Abdelnur
@author Alejandro Abdelnur
One instance of this class is created for one invocation of type library generation. This object keeps track of what type libraries are compiled into what packages, and keeps other "global" (per tlbimp invocation) state.
The actual details of the generation is delegated to other generator objects. @author Kohsuke Kawaguchi (kk@kohsuke.org)
All plug-in generators must extend this class (directly or not) and implement its methods to be usable by the software.
The task of an generator is to convert an instance of {@code Document} and create afile containing the content of the given instance in a known format. This task is achieved by calling the method {@code generate}. @author Schnell Michaël @version 1.0
Identifies the software implementation that produced the Atom feed.
Per RFC4287:
The "atom:generator" element's content identifies the agent used to generate a feed, for debugging and other purposes. The content of this element, when present, MUST be a string that is a human-readable name for the generating agent. Entities such as "&" and "<" represent their corresponding characters ("&" and "<" respectively), not markup. The atom:generator element MAY have a "uri" attribute whose value MUST be an IRI reference [RFC3987]. When dereferenced, the resulting URI (mapped from an IRI, if necessary) SHOULD produce a representation that is relevant to that agent. The atom:generator element MAY have a "version" attribute that indicates the version of the generating agent.
This is done with an abstract class (instead of an interface) so derived abstract classes can be subclassed from it w/out requiring all of the methods to be declared there.
The Generator is a frontend for working with the SchemaReaders, SourceWriters and whatever else.
Usage: Generates java source definitions from various inputs:
The inputs are interpreted into schema definitions by the {@link SchemaReader} set by calling{@link #setSchemaReader}.
Other properties give fine grained control over various aspects of the file generation:
and the processing of the schema:
Implementation note: If you update this interface, you should consider updating the following files and classes as well:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/64) | |N|V|V|V| |S| | (if payload len==126/127) | | |1|2|3| |K| | | +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | Extended payload length continued, if payload len == 127 | + - - - - - - - - - - - - - - - +-------------------------------+ | |Masking-key, if MASK set to 1 | +-------------------------------+-------------------------------+ | Masking-key (continued) | Payload Data | +-------------------------------- - - - - - - - - - - - - - - - + : Payload Data continued ... : + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | Payload Data continued ... | +---------------------------------------------------------------+
Purpose:The purpose of this class is to act as an entry point into the TopLink JAXB 2.0 Generation framework
Responsibilities:
This class acts as an entry point into JAXB 2.0 Generation. A Generator is created with a specific set of JAXB 2.0 Annotated classes and then performs actions on those, such as generating schema files, or generating TopLink Projects. Additional information is returned from the schema generation methods as a means of integration with WebServices. @author mmacivor @since Oracle TopLink 11.1.1.0.0 @see AnnotationsProcessor @see MappingsGenerator @see SchemaGenerator
Generator g = new Generator(); g.generate( "template.jtm" );You can specify the template using a String file path or a File object.
Generator
uses the default internal configuration so that it will work without any configuration files. To use Jostraca configuration files, specify a configuration folder using the constructors {@link #Generator(File)}or {@link #Generator(String)}.
You can also specify the settings to use when generating by passing in a {@link PropertySet} object, with your required settings.For example:
Generator g = new Generator(); PropertySet ps = new PropertySet(); ps.set( "main.MakeBackup", "no" ); g.setCmdPropertySet( ps ); g.generate( "template.jtm" );For a complete list of all configuration settings see the {@link Configuration Settings} reference.
To generate more than one template, use the {@link #generate(String[])}and {@link #generate(File[])} methods.
You can use the same Generator
object multiple times.
If the template you are generating only generates one output file, you can retrieve the result of the generation by calling {@link Template#getResult} on the {@link Template} object that is returned by the generate
methods.Note that this only works when you are using Java as the template script, and when you execute the template CodeWriter internally (this is the default).
To gain access to any error messages use the {@link #getUserMessageHandler} method.This returns a {@link org.jostraca.util.RecordingUserMessageHandler} object by default,which you will need to cast from the {@link org.jostraca.util.UserMessageHandler} interface returned by getUserMessageHandler.To use your own UserMessageHandler, use the method {@link #generate(String,UserMessageHandler)} and its equivalents.To send output to STDOUT
, use the {@link org.jostraca.util.CommandLineUserMessageHandler} as the UserMessageHandler parameter.
The following features are supported:
Title:代码生成器
Description:代码生成器接口,不同的代码生成器可以实现该接口,实现不同的代码生成器
Copyright:Copyright (c) 2011
@author liss @version 1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|