Skip to content

Commit

Permalink
#139: more args
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jun 15, 2017
1 parent 072a9c9 commit 7432dc1
Showing 1 changed file with 60 additions and 13 deletions.
73 changes: 60 additions & 13 deletions src/main/java/org/cactoos/io/InputAsLSInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,43 @@ public final class InputAsLSInput implements LSInput {
*/
private final Input input;

/**
* PublicID.
*/
private final String pid;

/**
* SystemID.
*/
private final String sid;

/**
* Base.
*/
private final String base;

/**
* Ctor.
* @param inpt Input
*/
public InputAsLSInput(final Input inpt) {
this(inpt, "#public", "#system", "#base");
}

/**
* Ctor.
* @param inpt Input
* @param pubid PublicID
* @param sysid SystemID
* @param bse Base
* @checkstyle ParameterNumberCheck (5 lines)
*/
public InputAsLSInput(final Input inpt, final String pubid,
final String sysid, final String bse) {
this.input = inpt;
this.pid = pubid;
this.sid = sysid;
this.base = bse;
}

@Override
Expand All @@ -64,7 +95,9 @@ public Reader getCharacterStream() {

@Override
public void setCharacterStream(final Reader stream) {
// nothing to do
throw new UnsupportedOperationException(
"#setCharacterStream() is not supported"
);
}

@Override
Expand All @@ -78,7 +111,9 @@ public InputStream getByteStream() {

@Override
public void setByteStream(final InputStream stream) {
// nothing to do
throw new UnsupportedOperationException(
"#setByteStream() is not supported"
);
}

@Override
Expand All @@ -92,37 +127,45 @@ public String getStringData() {

@Override
public void setStringData(final String data) {
// nothing to do
throw new UnsupportedOperationException(
"#setStringData() is not supported"
);
}

@Override
public String getSystemId() {
return "#system";
return this.sid;
}

@Override
public void setSystemId(final String sid) {
// nothing to do
public void setSystemId(final String sysid) {
throw new UnsupportedOperationException(
"#setSystemId() is not supported"
);
}

@Override
public String getPublicId() {
return "#public";
return this.pid;
}

@Override
public void setPublicId(final String pid) {
// nothing to do
public void setPublicId(final String pubid) {
throw new UnsupportedOperationException(
"#setPublicId() is not supported"
);
}

@Override
public String getBaseURI() {
return "#base";
return this.base;
}

@Override
public void setBaseURI(final String uri) {
// nothing to do
throw new UnsupportedOperationException(
"#setBaseURI() is not supported"
);
}

@Override
Expand All @@ -132,7 +175,9 @@ public String getEncoding() {

@Override
public void setEncoding(final String encoding) {
// nothing to do
throw new UnsupportedOperationException(
"#setEncoding() is not supported"
);
}

@Override
Expand All @@ -143,6 +188,8 @@ public boolean getCertifiedText() {

@Override
public void setCertifiedText(final boolean text) {
// nothing to do
throw new UnsupportedOperationException(
"#setCertifiedText() is not supported"
);
}
}

0 comments on commit 7432dc1

Please sign in to comment.