public class IlrJavaSerializer extends IlrAbstractSerializer
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
Name
The name of the serializer (the string
bom_java). |
| Constructor and Description |
|---|
IlrJavaSerializer() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName()
Returns the serializer name
|
void |
readObjectModel(IlrMutableObjectModel model,
java.io.Reader reader)
Reads object model elements from a reader and adds them into an existing
object model.
|
IlrDynamicObjectModel |
readObjectModel(java.io.Reader reader)
Reads an object model from a reader.
|
void |
writeObjectModel(IlrObjectModel objectModel,
java.io.Writer writer)
Writes an object model to a writer.
|
void |
writeObjectModel(IlrObjectModel objectModel,
java.io.Writer writer,
IlrSelector selector)
Writes parts of an object model to a writer.
|
void |
writeObjectModel(IlrObjectModel objectModel,
java.io.Writer writer,
IlrSelector selector,
java.util.Iterator initialTypes)
Writes parts of an object model to a writer.
|
void |
writePartialObjectModel(IlrObjectModel objectModel,
java.io.Writer writer,
IlrSelector selector) |
getClassLoader, isCompactMode, isJavaClassLookupEnabled, setClassLoader, setCompactMode, setJavaClassLookupEnabledpublic static final java.lang.String Name
bom_java).public final java.lang.String getName()
public void writeObjectModel(IlrObjectModel objectModel, java.io.Writer writer) throws java.io.IOException
java.io.IOException - if an I/O error occursobjectModel - an object modelpublic void writeObjectModel(IlrObjectModel objectModel, java.io.Writer writer, IlrSelector selector) throws java.io.IOException
selector
For a model element to be serialized it must be accepted by the selector along with all other model elements on which it depends.
It follows that if the given selector rejects a class (say C)
but accepts an attribute of another class having type C
then the attribute will not be serialized since its type
has been rejected. The same goes for methods with respect to their
parameter types, return type and exception types and also for
classes with respect to their superclasses and superinterfaces.
java.io.IOException - if an I/O error occursobjectModel - an object modelwriter - a writerselector - a selector which specifies which elements of the
object model will be serialized. If null
the object model is completely serialized.public void writeObjectModel(IlrObjectModel objectModel, java.io.Writer writer, IlrSelector selector, java.util.Iterator initialTypes) throws java.io.IOException
selector
This method writes the classes and enums given by the initialTypes
iterator along with their members (attributes, methods and tags). Other
types, not present in initialTypes but indirectly required
(such as the types of attribute, etc...) are also written but their members
are omitted.
Note that for a model element to be serialized it must also be accepted by the given selector along with all other model elements on which it depends.
It is recommended to use IlrSelectors.dynamicTypes(model) as
the value of the initialTypes parameter so that classes bound to
actual java classes are not serialized.
java.io.IOExceptionobjectModel - an object modelwriter - a writerselector - an object model subset selector. If null, then
IlrSelectors.AllElements is used.initialTypes - an iterator which iterates over the classes and enums that
must be fully serialized.public void writePartialObjectModel(IlrObjectModel objectModel, java.io.Writer writer, IlrSelector selector) throws java.io.IOException
java.io.IOExceptionpublic IlrDynamicObjectModel readObjectModel(java.io.Reader reader) throws java.io.IOException, IlrSyntaxError
java.io.IOException - if an I/O error occursIlrSyntaxError - if a syntax error occursreader - a reader.public void readObjectModel(IlrMutableObjectModel model, java.io.Reader reader) throws java.io.IOException, IlrSyntaxError
java.io.IOException - If an I/O error occurs.IlrSyntaxError - If a syntax error occurs.model - The objet model.reader - The reader.© Copyright IBM Corp. 1987, 2017