Class ServerConfigXmlDocument
- java.lang.Object
-
- io.openliberty.tools.common.plugins.config.XmlDocument
-
- io.openliberty.tools.common.plugins.config.ServerConfigXmlDocument
-
public class ServerConfigXmlDocument extends XmlDocument
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_INDENTATION-
Fields inherited from class io.openliberty.tools.common.plugins.config.XmlDocument
doc
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateComment(String comment)voidcreateComment(Element elem, String comment)voidcreateFeature(String name)Add the given feature to the feature manager element.ElementcreateFeatureManager()Create the feature manager element if it does not already existbooleancreateFMComment(String comment)voidcreateFMComment(Node insertionPoint, String comment)voidcreateVariableWithValue(String varName, String varValue, boolean isDefaultValue)voidcreateVariableWithValue(Element elem, String varName, String varValue, boolean isDefaultValue)ElementfindFeatureManager()NodefindFirstLevelComment(String comment)ElementfindServerElement()booleanhasFirstLevelComment(String comment)static ServerConfigXmlDocumentnewInstance()Create a new Document Object Model for a server configuration file with a single element: server.static ServerConfigXmlDocumentnewInstance(File f)Create a Document Object Model for a server configuration file and populate it from an existing XML file.booleanremoveFMComment(String comment)-
Methods inherited from class io.openliberty.tools.common.plugins.config.XmlDocument
addNewlineBeforeFirstElement, createDocument, createDocument, isIndented, isWhitespace, writeXMLDocument, writeXMLDocument
-
-
-
-
Field Detail
-
DEFAULT_INDENTATION
public static String DEFAULT_INDENTATION
-
-
Method Detail
-
newInstance
public static ServerConfigXmlDocument newInstance() throws ParserConfigurationException
Create a new Document Object Model for a server configuration file with a single element: server.- Returns:
- A reference to the object representing a new DOM
- Throws:
ParserConfigurationException
-
newInstance
public static ServerConfigXmlDocument newInstance(File f) throws ParserConfigurationException, SAXException, IOException
Create a Document Object Model for a server configuration file and populate it from an existing XML file. The file should be a valid server configuration file with one top-most element called "server."- Parameters:
f- An XML file to read in and store in the created DOM.- Returns:
- A reference to the object representing a new DOM
- Throws:
ParserConfigurationExceptionSAXExceptionIOException
-
createComment
public void createComment(String comment)
-
createFMComment
public boolean createFMComment(String comment)
-
removeFMComment
public boolean removeFMComment(String comment)
-
createVariableWithValue
public void createVariableWithValue(String varName, String varValue, boolean isDefaultValue)
-
createVariableWithValue
public void createVariableWithValue(Element elem, String varName, String varValue, boolean isDefaultValue)
-
createFeature
public void createFeature(String name)
Add the given feature to the feature manager element. Also creates the feature manager element if it does not already exist.- Parameters:
name- feature name
-
createFeatureManager
public Element createFeatureManager()
Create the feature manager element if it does not already exist
-
findFeatureManager
public Element findFeatureManager()
-
hasFirstLevelComment
public boolean hasFirstLevelComment(String comment)
-
findServerElement
public Element findServerElement()
-
-