Package org.opt4j.core.config
Class ModuleSaver
- java.lang.Object
-
- org.opt4j.core.config.ModuleSaver
-
public class ModuleSaver extends java.lang.Object
Helper class for saving thePropertyModule
configurations or adding these to XMLNode
s.
-
-
Constructor Summary
Constructors Constructor Description ModuleSaver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.w3c.dom.Document
getEmptyDocument()
protected org.w3c.dom.Node
getNode(com.google.inject.Module module, org.w3c.dom.Document document)
protected javax.xml.transform.Transformer
getStandardTransformer()
boolean
save(java.io.File file, java.util.Collection<? extends com.google.inject.Module> modules)
Save the module configurations to aFile
.boolean
save(java.lang.String filename, java.util.Collection<? extends com.google.inject.Module> modules)
Save the module configurations to a file (as filename).java.lang.String
toXMLString(com.google.inject.Module module)
Returns the xml representation of theModule
.java.lang.String
toXMLString(java.util.Collection<? extends com.google.inject.Module> modules)
Returns the xml representation of theModule
s.boolean
write(java.io.OutputStream out, com.google.inject.Module module)
Save the module configuration to anOutputStream
.boolean
write(java.io.OutputStream out, java.util.Collection<? extends com.google.inject.Module> modules)
Save the modules configuration to anOutputStream
.
-
-
-
Method Detail
-
save
public boolean save(java.lang.String filename, java.util.Collection<? extends com.google.inject.Module> modules)
Save the module configurations to a file (as filename).- Parameters:
filename
- the name of the filemodules
- the modules- Returns:
true
if successful
-
save
public boolean save(java.io.File file, java.util.Collection<? extends com.google.inject.Module> modules)
Save the module configurations to aFile
.- Parameters:
file
- the filemodules
- the modules- Returns:
true
if successful
-
write
public boolean write(java.io.OutputStream out, java.util.Collection<? extends com.google.inject.Module> modules)
Save the modules configuration to anOutputStream
.- Parameters:
out
- the output streammodules
- the modules- Returns:
true
if successful
-
write
public boolean write(java.io.OutputStream out, com.google.inject.Module module)
Save the module configuration to anOutputStream
.- Parameters:
out
- the output stream}module
- the module- Returns:
true
if successful
-
toXMLString
public java.lang.String toXMLString(com.google.inject.Module module)
Returns the xml representation of theModule
.- Parameters:
module
- the module- Returns:
- the xml representation
-
toXMLString
public java.lang.String toXMLString(java.util.Collection<? extends com.google.inject.Module> modules)
Returns the xml representation of theModule
s.- Parameters:
modules
- the modules- Returns:
- the xml representation
-
getEmptyDocument
protected org.w3c.dom.Document getEmptyDocument() throws javax.xml.parsers.ParserConfigurationException
- Throws:
javax.xml.parsers.ParserConfigurationException
-
getStandardTransformer
protected javax.xml.transform.Transformer getStandardTransformer() throws javax.xml.transform.TransformerConfigurationException
- Throws:
javax.xml.transform.TransformerConfigurationException
-
getNode
protected org.w3c.dom.Node getNode(com.google.inject.Module module, org.w3c.dom.Document document)
-
-