Package org.opt4j.config
Class ModuleSaver
- java.lang.Object
-
- org.opt4j.config.ModuleSaver
-
public class ModuleSaver extends Object
Helper class for saving thePropertyModuleconfigurations or adding these to XMLNodes.
-
-
Constructor Summary
Constructors Constructor Description ModuleSaver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DocumentgetEmptyDocument()protected NodegetNode(com.google.inject.Module module, Document document)protected TransformergetStandardTransformer()booleansave(File file, Collection<? extends com.google.inject.Module> modules)Save the module configurations to aFile.booleansave(String filename, Collection<? extends com.google.inject.Module> modules)Save the module configurations to a file (as filename).StringtoXMLString(com.google.inject.Module module)Returns the xml representation of theModule.StringtoXMLString(Collection<? extends com.google.inject.Module> modules)Returns the xml representation of theModules.booleanwrite(OutputStream out, com.google.inject.Module module)Save the module configuration to anOutputStream.booleanwrite(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:
trueif 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:
trueif 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:
trueif 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:
trueif 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 theModules.- Parameters:
modules- the modules- Returns:
- the xml representation
-
getEmptyDocument
protected Document getEmptyDocument() throws ParserConfigurationException
- Throws:
ParserConfigurationException
-
getStandardTransformer
protected Transformer getStandardTransformer() throws TransformerConfigurationException
-
-