Skip to content

Commit

Permalink
#3636: XMIR on XML
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 12, 2024
1 parent 671021c commit c039166
Showing 1 changed file with 58 additions and 6 deletions.
64 changes: 58 additions & 6 deletions eo-parser/src/main/java/org/eolang/parser/Xmir.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
import com.yegor256.xsline.TrLogged;
import com.yegor256.xsline.Train;
import com.yegor256.xsline.Xsline;
import java.util.Collection;
import java.util.List;
import java.util.logging.Level;
import javax.xml.namespace.NamespaceContext;
import org.w3c.dom.Node;
import org.xml.sax.SAXParseException;

/**
* Prints XMIR to EO or PHI.
Expand All @@ -51,7 +56,8 @@
* @link <a href="https://xml.jcabi.com">xml.jcabi.com</a>
* @since 0.35.0
*/
public final class Xmir {
@SuppressWarnings("PMD.TooManyMethods")
public final class Xmir implements XML {
/**
* Train of transformations that prepare XMIR for conversion to EO.
*/
Expand Down Expand Up @@ -115,6 +121,57 @@ public Xmir(final XML src) {
this.xml = src;
}

@Override
public String toString() {
return this.xml.toString();
}

@Override
public List<String> xpath(final String xpath) {
return this.xml.xpath(xpath);
}

@Override
public List<XML> nodes(final String xpath) {
return this.xml.nodes(xpath);
}

@Override
public XML registerNs(final String pfx, final Object uri) {
return this.xml.registerNs(pfx, uri);
}

@Override
public XML merge(final NamespaceContext ctx) {
return this.xml.merge(ctx);
}

@Override
@Deprecated
public Node node() {
throw new UnsupportedOperationException("deprecated");
}

@Override
public Node inner() {
return this.xml.inner();
}

@Override
public Node deepCopy() {
return this.xml.deepCopy();
}

@Override
public Collection<SAXParseException> validate() {
return this.xml.validate();
}

@Override
public Collection<SAXParseException> validate(final XML xsd) {
return this.xml.validate(xsd);
}

/**
* Converts XMIR to EO.
* @return EO representation as {@code String}
Expand Down Expand Up @@ -161,11 +218,6 @@ public String toPhiNoSugar() {
);
}

@Override
public String toString() {
return this.xml.toString();
}

/**
* Converts XMIR.
* @param train Train of transformations that prepares XMIR
Expand Down

0 comments on commit c039166

Please sign in to comment.