Search this API

y.io
Class XmlXslIOHandler

java.lang.Object
  extended by y.io.IOHandler
      extended by y.io.XmlXslIOHandler

public class XmlXslIOHandler
extends IOHandler

IOHandler that is able to read arbitrary XML files. An XSL stylesheet needs to be specified that transforms the input XML file to a valid input file for a reader delegate of type IOHandler.

 

Constructor Summary
XmlXslIOHandler()
          Creates a new instance of the IOHandler.
XmlXslIOHandler(GraphMLIOHandler readerDelegate)
          Creates a new instance of the IOHandler with the given reader delegate.
 
Method Summary
 boolean canWrite()
          Returns false.
 java.lang.String getFileFormatString()
          Returns a textual description of the IOHandler.
 java.lang.String getFileNameExtension()
          Returns the empty string since XML files can have file name extensions.
 IOHandler getReaderDelegate()
          Returns the IOHandler that will further process the XSL transformed XML input.
 javax.xml.transform.Source getXslSource()
          Returns the source for the XSL stylesheet to be used to transform the input.
 void read(Graph2D graph, java.io.InputStream in)
          Adds the contents that are read from the stream to the given graph.
 void setReaderDelegate(GraphMLIOHandler reader)
          Sets the IOHandler that will further process the XSL transformed XML input.
 void setXslSource(javax.xml.transform.Source xslSource)
          Sets the source for the XSL stylesheet to be used to transform the input.
 void write(Graph2D graph, java.io.OutputStream out)
          Writes the contents of the given graph to a stream
 
Methods inherited from class y.io.IOHandler
canRead, canWriteSubset, createObjectInputStream, createObjectOutputStream, hide, read, read, shouldSerialize, shouldSerialize, write, writeSubset, writeSubset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlXslIOHandler

public XmlXslIOHandler()
Creates a new instance of the IOHandler.


XmlXslIOHandler

public XmlXslIOHandler(GraphMLIOHandler readerDelegate)
Creates a new instance of the IOHandler with the given reader delegate.

Method Detail

getFileFormatString

public java.lang.String getFileFormatString()
Returns a textual description of the IOHandler.

Specified by:
getFileFormatString in class IOHandler

getFileNameExtension

public java.lang.String getFileNameExtension()
Returns the empty string since XML files can have file name extensions.

Specified by:
getFileNameExtension in class IOHandler

canWrite

public boolean canWrite()
Returns false.

Overrides:
canWrite in class IOHandler

setXslSource

public void setXslSource(javax.xml.transform.Source xslSource)
Sets the source for the XSL stylesheet to be used to transform the input.


getXslSource

public javax.xml.transform.Source getXslSource()
Returns the source for the XSL stylesheet to be used to transform the input.


setReaderDelegate

public void setReaderDelegate(GraphMLIOHandler reader)
Sets the IOHandler that will further process the XSL transformed XML input.


getReaderDelegate

public IOHandler getReaderDelegate()
Returns the IOHandler that will further process the XSL transformed XML input.


write

public void write(Graph2D graph,
                  java.io.OutputStream out)
           throws java.io.IOException
Description copied from class: IOHandler
Writes the contents of the given graph to a stream

Specified by:
write in class IOHandler
Throws:
java.io.IOException

read

public void read(Graph2D graph,
                 java.io.InputStream in)
          throws java.io.IOException
Description copied from class: IOHandler
Adds the contents that are read from the stream to the given graph. The given graph will not be cleared when the content of the file will be added to it.

Specified by:
read in class IOHandler
Throws:
java.io.IOException

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.