org.xmloperator.lambda.tree.serialize
Interface Serializer

All Known Implementing Classes:
PrefixedSerializer, UsualSerializer

public interface Serializer

Term serializer.


Method Summary
 Term readTerm(java.io.Reader in, TermFactory termFactory)
          Produces a Term from a previous serialization.
 void underlineRedex(java.io.PrintWriter out, Term term, Application underlinedRedex)
          Writes a string value that underline a redex.
 void underlineTerm(java.io.PrintWriter out, Term term, Term underlinedTerm)
          Writes a string value that underline a sub-Term.
 void writeTerm(java.io.PrintWriter out, Term term)
          Writes a Term.
 

Method Detail

writeTerm

public void writeTerm(java.io.PrintWriter out,
                      Term term)
Writes a Term.

Parameters:
out - a PrintWriter.
term - a Term to write out.
Throws:
java.lang.NullPointerException - if the Term is broken.

underlineTerm

public void underlineTerm(java.io.PrintWriter out,
                          Term term,
                          Term underlinedTerm)
                   throws java.lang.UnsupportedOperationException
Writes a string value that underline a sub-Term.

Parameters:
out - a PrintWriter.
term - a Term.
underlinedTerm - a sub-Term to underline.
Throws:
java.lang.NullPointerException - if the Expression is broken or if the sub-term is null.
java.lang.UnsupportedOperationException - if this serializer doesn't support this operation.

underlineRedex

public void underlineRedex(java.io.PrintWriter out,
                           Term term,
                           Application underlinedRedex)
                    throws java.lang.UnsupportedOperationException
Writes a string value that underline a redex.

Parameters:
out - a PrintWriter.
term - a Term.
underlinedRedex - a redex to underline.
Throws:
java.lang.NullPointerException - if the Expression is broken or if the redex is null.
java.lang.UnsupportedOperationException - if this serializer doesn't support this operation.

readTerm

public Term readTerm(java.io.Reader in,
                     TermFactory termFactory)
              throws java.io.IOException
Produces a Term from a previous serialization.

Parameters:
in - a Reader.
termFactory - the factory for building the Term.
Returns:
the created Term.
Throws:
java.lang.IllegalArgumentException - if the given TermFactory or the given Reader is null.
ParsingException - if no Term can be build.
java.io.IOException