org.eclipse.xsd.example
Class XSDMainExample

java.lang.Object
  extended by org.eclipse.xsd.example.XSDMainExample

public class XSDMainExample
extends java.lang.Object

Supports command line invocation to drive XML Schema model examples. It handles both headless invocation and standalone invocation.

You can execute one of these example by running

  xsd-example.bat
or
  xsd-standalone-example.bat
from the directory:
  plugins/org.eclipse.xsd.example/data/

See Also:
run(java.lang.Object), main(java.lang.String[])

Nested Class Summary
static class XSDMainExample.Runnable
           
 
Constructor Summary
XSDMainExample()
          Creates an instance.
 
Method Summary
 void loadAndPrint(java.lang.String xsdFile)
          Load the XML Schema file and print information about it.
static void main(java.lang.String[] args)
          Executes a stand-alone example.
protected  void printDirectives(java.lang.String indent, XSDSchema xsdSchema)
          Prints directive tags for those directives that reference the given schema.
protected  void printSchemaStart(XSDSchema xsdSchema)
          Prints a header tag for the given schema.
 java.lang.Object run(java.lang.Object object)
          Executes a headless workbench example.
 void validate(java.lang.String xsdFile)
          Load the XML Schema file and print any diagnostics information about it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSDMainExample

public XSDMainExample()
Creates an instance.

Method Detail

main

public static void main(java.lang.String[] args)
Executes a stand-alone example.

Parameters:
args - an array of Strings from the command line.
See Also:
run(java.lang.Object)

run

public java.lang.Object run(java.lang.Object object)
Executes a headless workbench example. If no arguments are provided, the XSDPrototypicalSchema will be tested; otherwise each argument is taken to be the URI of a schema which will be loaded and printed.

Parameters:
object - an array of Strings from the command line, each representing the URI of a schema.
Returns:
0 indicating success, or 1 indicating failure.
See Also:
main(java.lang.String[])

printSchemaStart

protected void printSchemaStart(XSDSchema xsdSchema)
Prints a header tag for the given schema.

Parameters:
xsdSchema - a schema.

printDirectives

protected void printDirectives(java.lang.String indent,
                               XSDSchema xsdSchema)
Prints directive tags for those directives that reference the given schema.

Parameters:
indent - the indentation string to print at the start of each line.
xsdSchema - a schema.

loadAndPrint

public void loadAndPrint(java.lang.String xsdFile)
                  throws java.lang.Exception
Load the XML Schema file and print information about it.

Parameters:
xsdFile - the URI of an XML Schema file.
Throws:
java.lang.Exception

validate

public void validate(java.lang.String xsdFile)
              throws java.lang.Exception
Load the XML Schema file and print any diagnostics information about it.

Parameters:
xsdFile - the URI of an XML Schema file.
Throws:
java.lang.Exception

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.