|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xsd.example.XSDGenerateHTML
public class XSDGenerateHTML
Generates HTML annotated documentation that summarizes the built-in simple type hierarchy.
It implements the method run
,
which is called just like main during headless workbench invocation.
You can execute this example by running
xsd-generate-schema-for-schema-html.batfrom the directory:
plugins/org.eclipse.xsd.example/data/This script uses the file
plugins/org.eclipse.xsd.example/SampleMarkup.xmlfor annotations. The resultin HTML document is stored in
SchemaForSchema.html
and an index.html
is provided frame-based viewing of the document.
The script
xsd-generate-html.batallows you to pass in your own annotations.
Field Summary | |
---|---|
static java.lang.String |
ALLOWS
A markup style indicating the feature not required to be supported. |
java.util.Map<java.lang.String,java.lang.String> |
attributeDeclarationMarkupMap
The map from String keys to documentation for XSDAttributeDeclaration s. |
java.util.Map<java.lang.String,java.lang.String> |
contentDocumentationMap
The map from String keys to documentation. |
java.util.Map<java.lang.String,java.lang.String> |
elementDeclarationMarkupMap
The map from String keys to documentation for XSDElementDeclaration . |
protected java.lang.String |
errata
The URL for errata. |
static java.lang.String |
FUTURE
A markup style indicating the feature will eventually be required to be supported. |
static java.lang.String |
NEVER
A markup style indicating the feature will never be required to be supported. |
protected java.util.List<java.lang.String> |
part1Anchors
The list of anchors in Part 1. |
protected java.util.List<java.lang.String> |
part2Anchors
The list of anchors in Part 2. |
protected java.util.List<java.lang.String> |
part2Components
The list of components in Part 2. |
static java.lang.String |
REQUIRES
A markup style indicating the feature is required to be supported. |
java.util.Map<java.lang.String,java.lang.String> |
schemaTypeToJavaClassMap
The map from schema type to Java class. |
java.util.Map<XSDElementDeclaration,XSDElementDeclaration> |
specialAnchorMap
The map from XSDElementDeclaration to an anchor string. |
Fields inherited from interface org.eclipse.equinox.app.IApplication |
---|
EXIT_OK, EXIT_RELAUNCH, EXIT_RESTART |
Constructor Summary | |
---|---|
XSDGenerateHTML()
Creates an instance. |
Method Summary | |
---|---|
java.lang.String |
getAttributeDeclarationDocumentation(java.lang.String key)
Returns the attribute documentation associated with the key. |
java.lang.String |
getAttributeDeclarationMarkup(java.lang.String key)
Returns the attribute markup associated with the key. |
java.lang.String |
getComponentLinks(XSDElementDeclaration xsdElementDeclaration)
Returns an href in Part 1 or Part 2 of the component specification for the given element. |
java.lang.String |
getContentDocumentation(java.lang.String key)
Returns the content documentation associated with the key. |
java.lang.String |
getElementDeclarationDocumentation(java.lang.String key)
Returns the element documentation associated with the key. |
java.lang.String |
getElementDeclarationMarkup(java.lang.String key)
Returns the element markup associated with the key. |
java.lang.String |
getLocalAnchor(XSDElementDeclaration xsdElementDeclaration)
Returns an anchor that can be used locally for the given element declaration. |
java.lang.String |
getSimpleTypeDefinitionLink(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
Returns an href in Part 2 of the component specification for the given simple type definition. |
java.lang.String |
getStandardLink(XSDElementDeclaration xsdElementDeclaration)
Returns an href in Part 1 or Part 2 of the XML specification for the given element. |
void |
handleMarkup(java.util.Map<java.lang.String,java.lang.String> markupMap,
org.w3c.dom.Element markupElement)
Handle a markup element by caching information in a map. |
void |
loadAndPrint(java.lang.String xsdFile)
Load the XML Schema file and print the documentation based on it. |
void |
printFooter()
Print the end of the document. |
void |
printHeader()
Print the start of the document. |
void |
printParticle(XSDParticle xsdParticle,
java.lang.String rootElementDeclarationMarkup)
Print a particle with markup for the document. |
void |
printSimpleTypeDefinition(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
Print a simple type definition for the document. |
void |
readMarkup(java.lang.String fileName)
Read the markup from the .xml input. |
java.lang.Object |
run(java.lang.Object object)
Generate HTML annotated documentation that summarizes the built-in simple type hierarchy. |
java.lang.Object |
start(IApplicationContext context)
|
void |
stop()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.Map<java.lang.String,java.lang.String> schemaTypeToJavaClassMap
public java.util.Map<java.lang.String,java.lang.String> contentDocumentationMap
readMarkup(java.lang.String)
,
handleMarkup(java.util.Map, org.w3c.dom.Element)
public java.util.Map<java.lang.String,java.lang.String> elementDeclarationMarkupMap
XSDElementDeclaration
.
readMarkup(java.lang.String)
,
handleMarkup(java.util.Map, org.w3c.dom.Element)
public java.util.Map<java.lang.String,java.lang.String> attributeDeclarationMarkupMap
XSDAttributeDeclaration
s.
readMarkup(java.lang.String)
,
handleMarkup(java.util.Map, org.w3c.dom.Element)
public java.util.Map<XSDElementDeclaration,XSDElementDeclaration> specialAnchorMap
XSDElementDeclaration
to an anchor string.
protected java.util.List<java.lang.String> part1Anchors
protected java.util.List<java.lang.String> part2Anchors
protected java.util.List<java.lang.String> part2Components
protected java.lang.String errata
public static final java.lang.String REQUIRES
public static final java.lang.String ALLOWS
public static final java.lang.String FUTURE
public static final java.lang.String NEVER
Constructor Detail |
---|
public XSDGenerateHTML()
Method Detail |
---|
public void readMarkup(java.lang.String fileName)
fileName
- the name of an XML file.public void handleMarkup(java.util.Map<java.lang.String,java.lang.String> markupMap, org.w3c.dom.Element markupElement)
markupMap
- the map to contain the markup.markupElement
- the element specifying the markup.public java.lang.String getContentDocumentation(java.lang.String key)
key
- the key to look up.
handleMarkup(java.util.Map, org.w3c.dom.Element)
public java.lang.String getElementDeclarationMarkup(java.lang.String key)
key
- the key to look up.
handleMarkup(java.util.Map, org.w3c.dom.Element)
public java.lang.String getElementDeclarationDocumentation(java.lang.String key)
key
- the key to look up.
handleMarkup(java.util.Map, org.w3c.dom.Element)
public java.lang.String getAttributeDeclarationMarkup(java.lang.String key)
key
- the key to look up.
handleMarkup(java.util.Map, org.w3c.dom.Element)
public java.lang.String getAttributeDeclarationDocumentation(java.lang.String key)
key
- the key to look up.
handleMarkup(java.util.Map, org.w3c.dom.Element)
public java.lang.String getStandardLink(XSDElementDeclaration xsdElementDeclaration)
xsdElementDeclaration
- an element declaration in the schema for schema.
public java.lang.String getComponentLinks(XSDElementDeclaration xsdElementDeclaration)
xsdElementDeclaration
- a simple type defintion in the schema for schema.
public java.lang.String getSimpleTypeDefinitionLink(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
xsdSimpleTypeDefinition
- an element declaration in the schema for schema.
public java.lang.String getLocalAnchor(XSDElementDeclaration xsdElementDeclaration)
xsdElementDeclaration
- an element declaration in the schema for schema.
public java.lang.Object start(IApplicationContext context) throws java.lang.Exception
start
in interface IApplication
java.lang.Exception
public void stop()
stop
in interface IApplication
public java.lang.Object run(java.lang.Object object)
object
- an array of Strings.
0
indicating success, or 1
indicating failure.public void printHeader()
public void printFooter()
public void loadAndPrint(java.lang.String xsdFile) throws java.lang.Exception
xsdFile
- the name of an XML Schema file.
java.lang.Exception
public void printParticle(XSDParticle xsdParticle, java.lang.String rootElementDeclarationMarkup)
xsdParticle
- a particle.rootElementDeclarationMarkup
- the markup.public void printSimpleTypeDefinition(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
xsdSimpleTypeDefinition
- a simple type definition in the schema for schema.
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |