public final class XmlConstraintSaver
extends java.lang.Object
XmlConstraintSaver
class provides functionality to save a constraint with all
its attributes to an XML file.Constructor and Description |
---|
XmlConstraintSaver(Constraint constraint)
Constructs an XMLConstraintSaver object that saves the specified constraint to the specified
XML document.
|
Modifier and Type | Method and Description |
---|---|
void |
save(java.io.OutputStream output)
Saves the constraint object to an
OutputStream . |
void |
saveToFile(java.lang.String fileName)
Saves the constraint object to an XML file.
|
java.lang.String |
saveToString()
Saves the constraint object to an XML string.
|
public XmlConstraintSaver(Constraint constraint)
constraint
- Constraint to be save.java.lang.IllegalArgumentException
- if the parameter equals null
;
if the constraint is not formula-based (its type is not
FORMULA_BASED). Currently, the possibility of saving other
constraint types is not implemented.public java.lang.String saveToString() throws XmlNotSavedException
XmlNotSavedException
- if failed to save the constraint to a string.public void saveToFile(java.lang.String fileName) throws XmlNotSavedException
fileName
- Target XML document file name.java.lang.IllegalArgumentException
- if the parameter equals null
.XmlNotSavedException
- if failed to save the constraint to a file.public void save(java.io.OutputStream output) throws XmlNotSavedException
OutputStream
.output
- OutputStream
to store constraint.java.lang.IllegalArgumentException
- if the parameter equals null
.XmlNotSavedException
- if failed to save the constraint to a file.