you managed to figure out that SchemaCodePrinter is not a class, and still
tried to instantiate it? being an interface it provides you with a contract
so that you can have your own implementation

2008/12/19 michael <michael....@gmail.com>

> Hi again,
>
> I have a new question for xmlbeans API since i managed to compile and
> excercise a little bit.
>
> I wonder if there is a way to print on screen a single schema component
> (eg. an element,a type etc)
>
> I found on doc an interface called : SchemaCodePrinter
>
> that implements 3 methods
>
> *Method Summary*
> | void|         |*printLoader
> <
> http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/SchemaCodePrinter.html#printLoader%28java.io.Writer,%20org.apache.xmlbeans.SchemaTypeSystem%29
> >*(Writer
> <http://java.sun.com/j2se/1.4.2/docs/api/java/io/Writer.html> writer,
> SchemaTypeSystem
> <
> http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/SchemaTypeSystem.html>
> system)|
>
>          *Deprecated.* /Obsoleted by functionality in
> |SchemaTypeSystem.save()|/
> | void|         |*printType
> <
> http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/SchemaCodePrinter.html#printType%28java.io.Writer,%20org.apache.xmlbeans.SchemaType%29
> >*(Writer
> <http://java.sun.com/j2se/1.4.2/docs/api/java/io/Writer.html> writer,
> SchemaType
> <
> http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/SchemaType.html>
> sType)|
>
>
> | void|         |*printTypeImpl
> <
> http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/SchemaCodePrinter.html#printTypeImpl%28java.io.Writer,%20org.apache.xmlbeans.SchemaType%29
> >*(Writer
> <http://java.sun.com/j2se/1.4.2/docs/api/java/io/Writer.html> writer,
> SchemaType
> <
> http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/SchemaType.html>
> sType)|
>
>
>
>
> I am trying to use it ,so i wrote this piece of code
>
>
> ---------------------------------------------------------------------------------------
> //STS is a SchemaTypeSystem....
>
> SchemaType ST[] = STS.globalTypes()
>
> SchemaCodePrinter SCP;
>
>    StringWriter SW = new StringWriter();
>
>    String SCPstring;
>
>    SCP.printType(SW,ST[0]);
>
>
> ---------------------------------------------------------------------------------------
>
> and i get as an error message this :
>
> ---------------------------------------------------------------------------------------
> The local variable SCP may not have been initialized
>
> ---------------------------------------------------------------------------------------
>
> But the SchemaCodePrinter is not a class so when do a new
> SchemaCodePrinter i get
>
> ---------------------------------------------------------------------------------------
> Cannot instantiate the type SchemaCodePrinter
>
> ---------------------------------------------------------------------------------------
>
> How i can modulate this code to print on screen the schema component?
>
> For start i want to print it on screen and then put it on a file for
> work purposes.
>
> Thanks in advance,
>
> Michael
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
> For additional commands, e-mail: user-h...@xmlbeans.apache.org
>
>

Reply via email to