eu.monnetproject.lemon.impl
Class LemonSerializerImpl

java.lang.Object
  extended by eu.monnetproject.lemon.LemonSerializer
      extended by eu.monnetproject.lemon.impl.LemonSerializerImpl

public class LemonSerializerImpl
extends LemonSerializer

A serializer for in-memory lemon models

Author:
John McCrae

Field Summary
 
Fields inherited from class eu.monnetproject.lemon.LemonSerializer
remoteUpdateFactory
 
Constructor Summary
LemonSerializerImpl(LinguisticOntology lingOnto)
          DO NOT USE!.
 
Method Summary
 void close()
          Close the connection to the serializer.
 LemonModel create()
          Create a blank model.
 LemonModel create(URI context)
          Deprecated. 
 void moveLexicon(Lexicon lexicon, LemonModel from, LemonModel to)
          Move a lexicon from one model to another.
 void read(LemonModel lm, Reader source)
          Read a lemon model putting the data in a given model
 LemonModel read(Reader source)
          Read a lemon model from a given data source
 LexicalEntry readEntry(Reader source)
          Read a single entry
 void write(LemonModel model, Writer target)
          Write a lemon model to a given data source
 void write(LemonModel lm, Writer dt, boolean xml)
          Write a lemon model to a given data source
 void writeEntry(LemonModel model, LexicalEntry entry, LinguisticOntology lingOnto, Writer target)
          Write a single entry to a file
 void writeEntry(LemonModel lm, LexicalEntry le, LinguisticOntology lo, Writer dt, boolean xml)
          Write a single entry to a file
 void writeLexicon(LemonModel model, Lexicon lexicon, LinguisticOntology lingOnto, Writer target)
          Write a single lexicon to a file
 void writeLexicon(LemonModel lm, Lexicon lxcn, LinguisticOntology lo, Writer dt, boolean xml)
          Write a single lexicon to a file
 
Methods inherited from class eu.monnetproject.lemon.LemonSerializer
modelFromURL, newInstance, newInstance, setRemoteUpdateFactory, writeLexiconDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LemonSerializerImpl

public LemonSerializerImpl(LinguisticOntology lingOnto)
DO NOT USE!. Obtain a serializer by LemonSerializer.newInstance()

Parameters:
lingOnto -
Method Detail

read

public LemonModel read(Reader source)
Description copied from class: LemonSerializer
Read a lemon model from a given data source

Specified by:
read in class LemonSerializer

write

public void write(LemonModel model,
                  Writer target)
Description copied from class: LemonSerializer
Write a lemon model to a given data source

Specified by:
write in class LemonSerializer
Parameters:
model - The model to write
target - The target to write to

create

public LemonModel create()
Description copied from class: LemonSerializer
Create a blank model.

Specified by:
create in class LemonSerializer

create

@Deprecated
public LemonModel create(URI context)
Deprecated. 

Description copied from class: LemonSerializer
Create a blank model

Specified by:
create in class LemonSerializer
Parameters:
context - The context of the model or null for no context

writeEntry

public void writeEntry(LemonModel model,
                       LexicalEntry entry,
                       LinguisticOntology lingOnto,
                       Writer target)
Description copied from class: LemonSerializer
Write a single entry to a file

Specified by:
writeEntry in class LemonSerializer
Parameters:
model - The model to write from
entry - The entry to write
lingOnto - The linguistic ontology (necessary to avoid following to other entries)
target - The target to write to

writeLexicon

public void writeLexicon(LemonModel model,
                         Lexicon lexicon,
                         LinguisticOntology lingOnto,
                         Writer target)
Description copied from class: LemonSerializer
Write a single lexicon to a file

Specified by:
writeLexicon in class LemonSerializer
Parameters:
model - The model to write from
lexicon - The lexicon to write
lingOnto - The linguistic ontology (necessary to avoid following to other entries)
target - The target to write to

moveLexicon

public void moveLexicon(Lexicon lexicon,
                        LemonModel from,
                        LemonModel to)
Description copied from class: LemonSerializer
Move a lexicon from one model to another. Note this may not work if the models were created by different serializers

Specified by:
moveLexicon in class LemonSerializer
Parameters:
lexicon - The lexicon to move
from - The source model containing the lexicon
to - The target model

read

public void read(LemonModel lm,
                 Reader source)
Description copied from class: LemonSerializer
Read a lemon model putting the data in a given model

Specified by:
read in class LemonSerializer

readEntry

public LexicalEntry readEntry(Reader source)
Description copied from class: LemonSerializer
Read a single entry

Specified by:
readEntry in class LemonSerializer

write

public void write(LemonModel lm,
                  Writer dt,
                  boolean xml)
Description copied from class: LemonSerializer
Write a lemon model to a given data source

Specified by:
write in class LemonSerializer
Parameters:
lm - The model to write
dt - The target to write to
xml - Write as XML?

writeEntry

public void writeEntry(LemonModel lm,
                       LexicalEntry le,
                       LinguisticOntology lo,
                       Writer dt,
                       boolean xml)
Description copied from class: LemonSerializer
Write a single entry to a file

Specified by:
writeEntry in class LemonSerializer
Parameters:
lm - The model to write from
le - The entry to write
lo - The linguistic ontology (necessary to avoid following to other entries)
dt - The target to write to
xml - Write as XML?

writeLexicon

public void writeLexicon(LemonModel lm,
                         Lexicon lxcn,
                         LinguisticOntology lo,
                         Writer dt,
                         boolean xml)
Description copied from class: LemonSerializer
Write a single lexicon to a file

Specified by:
writeLexicon in class LemonSerializer
Parameters:
lm - The model to write from
lxcn - The lexicon to write
lo - The linguistic ontology (necessary to avoid following to other entries)
dt - The target to write to
xml - Write as XML?

close

public void close()
Description copied from class: LemonSerializer
Close the connection to the serializer.

Specified by:
close in class LemonSerializer


Copyright © 2012. All Rights Reserved.