org.objectweb.jac.aspects.export
Class Exporter

java.lang.Object
  extended byorg.objectweb.jac.aspects.export.Exporter

public class Exporter
extends Object


Constructor Summary
Exporter(Collection roots, Collection allow, Collection deny)
          Creates a new exporter.
Exporter(String[] roots, String[] allow, String[] deny)
           
 
Method Summary
protected  boolean allowExport(ClassItem cli)
          Tells wether instances of a class should be exported or not
static String escapeChar(char c)
           
static String escapeString(String s)
           
 void export(File file)
          Exports all objects to a file
 void export(OutputStream outStream)
          Exports all objects to a stream, using UTF-8 encoding.
 void export(OutputStream outStream, String encoding)
          Exports all objects to a stream
 void export(Writer out, Object o, String name, String opath)
          Exports an object to a stream
protected  void writeValue(Writer out, Object value, String opath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exporter

public Exporter(String[] roots,
                String[] allow,
                String[] deny)
See Also:
Exporter(Collection,Collection,Collection)

Exporter

public Exporter(Collection roots,
                Collection allow,
                Collection deny)
Creates a new exporter.

Parameters:
roots - collection of String naming root objects to start export from.
allow - collection of String naming classes to export
deny - collection of String naming classes not to export
See Also:
Exporter(String[],String[],String[])
Method Detail

export

public void export(File file)
            throws IOException
Exports all objects to a file

Throws:
IOException

export

public void export(OutputStream outStream)
            throws IOException
Exports all objects to a stream, using UTF-8 encoding.

Throws:
IOException

export

public void export(OutputStream outStream,
                   String encoding)
            throws IOException
Exports all objects to a stream

Throws:
IOException

escapeChar

public static String escapeChar(char c)

escapeString

public static String escapeString(String s)

allowExport

protected boolean allowExport(ClassItem cli)
Tells wether instances of a class should be exported or not

Parameters:
cli - a class item
Returns:
true if instances of this class should be exported. Instances of a class are exported if the class is not listed in the deny list and is listed in the allow list.

export

public void export(Writer out,
                   Object o,
                   String name,
                   String opath)
            throws IOException
Exports an object to a stream

Parameters:
out - the stream to which to export
o - the object to export
name - name of the object to export
Throws:
IOException

writeValue

protected void writeValue(Writer out,
                          Object value,
                          String opath)
                   throws IOException
Throws:
IOException