Package org.opt4j.config
Class ModuleSaver
- java.lang.Object
-
- org.opt4j.config.ModuleSaver
-
public class ModuleSaver extends 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 Document
getEmptyDocument()
protected Node
getNode(com.google.inject.Module module, Document document)
protected Transformer
getStandardTransformer()
boolean
save(File file, Collection<? extends com.google.inject.Module> modules)
Save the module configurations to aFile
.boolean
save(String filename, Collection<? extends com.google.inject.Module> modules)
Save the module configurations to a file (as filename).String
toXMLString(com.google.inject.Module module)
Returns the xml representation of theModule
.String
toXMLString(Collection<? extends com.google.inject.Module> modules)
Returns the xml representation of theModule
s.boolean
write(OutputStream out, com.google.inject.Module module)
Save the module configuration to anOutputStream
.boolean
write(OutputStream out, Collection<? extends com.google.inject.Module> modules)
Save the modules configuration to anOutputStream
.
-
-
-
Method Detail
-
save
public boolean save(String filename, 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(File file, 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(OutputStream out, 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(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 String toXMLString(com.google.inject.Module module)
Returns the xml representation of theModule
.- Parameters:
module
- the module- Returns:
- the xml representation
-
toXMLString
public String toXMLString(Collection<? extends com.google.inject.Module> modules)
Returns the xml representation of theModule
s.- Parameters:
modules
- the modules- Returns:
- the xml representation
-
getEmptyDocument
protected Document getEmptyDocument() throws ParserConfigurationException
- Throws:
ParserConfigurationException
-
getStandardTransformer
protected Transformer getStandardTransformer() throws TransformerConfigurationException
-
-