public abstract class AbstractXmlResourceFacet extends AbstractBaseFacet
xmlProperties
.Modifier and Type | Field and Description |
---|---|
protected XmlParserFactory |
xmlParserFactory |
protected XPathFactory |
xPathFactory
The properties used when writing to an XML file.
|
MAIN_PROFILE
Constructor and Description |
---|
AbstractXmlResourceFacet() |
Modifier and Type | Method and Description |
---|---|
protected abstract Map<XPathExpression,Collection<Node>> |
getElementsToInsert(XPath xPath,
ElementFactory elemFactory)
Get DOM nodes to write to an XML configuration file.
|
protected Map<XPathExpression,Collection<Node>> |
getElementsToVerify(XPath xPath,
ElementFactory elemFactory)
Get a map of parent nodes to xml fragments used to verify the installation
of this facet.
|
protected abstract String |
getRelPath()
Get the relative path of XML file to be configured by this facet.
|
protected abstract Map<XPathExpression,Node> |
getRemovalMap(XPath xPath,
ElementFactory elemFactory)
Return a map of xpath expressions of nodes to be replaced to their
replacements, used when this facet is uninstalled.
|
protected abstract Map<XPathExpression,Node> |
getReplacements(XPath xPath,
ElementFactory elemFactory)
Get a Map of nodes to be replaced in an XML configuration file.
|
protected File |
getResFile(String relPath) |
boolean |
install() |
boolean |
isInstalled() |
boolean |
uninstall() |
addDependenciesToProfile, error, getDependency, getDependency, getProject, hasDependency, hasProvidedDependency, warning
equals, getFaceted, hashCode, setFaceted
protected final XPathFactory xPathFactory
OutputKeys}, {@link Transformer}
@Inject protected XmlParserFactory xmlParserFactory
public boolean install()
public boolean isInstalled()
protected Map<XPathExpression,Collection<Node>> getElementsToVerify(XPath xPath, ElementFactory elemFactory) throws ParserConfigurationException, XPathExpressionException
getElementsToInsert
.public boolean uninstall()
uninstall
in interface org.jboss.forge.addon.facets.Facet<org.jboss.forge.addon.projects.Project>
uninstall
in class org.jboss.forge.addon.facets.AbstractFacet<org.jboss.forge.addon.projects.Project>
protected abstract Map<XPathExpression,Node> getRemovalMap(XPath xPath, ElementFactory elemFactory) throws ParserConfigurationException, XPathExpressionException
xPath
- Used to generate XPathExpressions
.elemFactory
- Used to generate Nodes
.ParserConfigurationException
XPathExpressionException
protected abstract Map<XPathExpression,Collection<Node>> getElementsToInsert(XPath xPath, ElementFactory elemFactory) throws ParserConfigurationException, XPathExpressionException
elemFactory
- The returned nodes should be created with this.xPath
- Used to generate xpath expressions for finding nodes to add
children to.XPathExpressions
(for finding
parent nodes), to collections of Nodes
to add as
children.ParserConfigurationException
XPathExpressionException
protected abstract Map<XPathExpression,Node> getReplacements(XPath xPath, ElementFactory elemFactory) throws ParserConfigurationException, XPathExpressionException
elemFactory
- The returned nodes should be created with this.xPath
- Used to generate xpath expressions for finding nodes to replace.XPathExpressions
(for finding
nodes to replace), to replacement Nodes
to add as
children.ParserConfigurationException
XPathExpressionException
protected abstract String getRelPath()
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.