Search in sources :

Example 1 with MavenXmlView

use of org.commonjava.maven.galley.maven.model.view.MavenXmlView in project pom-manipulation-ext by release-engineering.

the class GalleyAPIWrapper method parseXmlView.

public MavenXmlView<ProjectRef> parseXmlView(final String xml) throws GalleyMavenXMLException {
    final Document document = infra.getXml().parseDocument(xml, new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
    final DocRef<ProjectRef> ref = new DocRef<ProjectRef>(new SimpleProjectRef("unknown", "unknown"), xml, document);
    return new MavenXmlView<>(Collections.singletonList(ref), infra.getXPath(), infra.getXml());
}
Also used : SimpleProjectRef(org.commonjava.maven.atlas.ident.ref.SimpleProjectRef) MavenXmlView(org.commonjava.maven.galley.maven.model.view.MavenXmlView) ByteArrayInputStream(java.io.ByteArrayInputStream) DocRef(org.commonjava.maven.galley.maven.model.view.DocRef) Document(org.w3c.dom.Document) SimpleProjectRef(org.commonjava.maven.atlas.ident.ref.SimpleProjectRef) ProjectRef(org.commonjava.maven.atlas.ident.ref.ProjectRef)

Aggregations

ByteArrayInputStream (java.io.ByteArrayInputStream)1 ProjectRef (org.commonjava.maven.atlas.ident.ref.ProjectRef)1 SimpleProjectRef (org.commonjava.maven.atlas.ident.ref.SimpleProjectRef)1 DocRef (org.commonjava.maven.galley.maven.model.view.DocRef)1 MavenXmlView (org.commonjava.maven.galley.maven.model.view.MavenXmlView)1 Document (org.w3c.dom.Document)1