-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29ed2b0
commit 7819319
Showing
4 changed files
with
88 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...o.strangeskies.modabi.core.api/src/uk/co/strangeskies/modabi/io/DiscardingDataTarget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package uk.co.strangeskies.modabi.io; | ||
|
||
public class DiscardingDataTarget extends DataTargetDecorator { | ||
public DiscardingDataTarget() { | ||
super(new DataTarget() { | ||
@Override | ||
public void terminate() {} | ||
|
||
@Override | ||
public <T> DataTarget put(DataItem<T> item) { | ||
return this; | ||
} | ||
|
||
@Override | ||
public DataStreamState currentState() { | ||
return null; | ||
} | ||
}); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
....core.api/src/uk/co/strangeskies/modabi/io/structured/DiscardingStructuredDataTarget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package uk.co.strangeskies.modabi.io.structured; | ||
|
||
import uk.co.strangeskies.modabi.Namespace; | ||
import uk.co.strangeskies.modabi.QualifiedName; | ||
import uk.co.strangeskies.modabi.io.DataTarget; | ||
import uk.co.strangeskies.modabi.io.DiscardingDataTarget; | ||
|
||
public class DiscardingStructuredDataTarget | ||
extends StructuredDataTargetImpl<DiscardingStructuredDataTarget> { | ||
@Override | ||
protected void registerDefaultNamespaceHintImpl(Namespace namespace) {} | ||
|
||
@Override | ||
protected void registerNamespaceHintImpl(Namespace namespace) {} | ||
|
||
@Override | ||
protected void commentImpl(String comment) {} | ||
|
||
@Override | ||
protected void nextChildImpl(QualifiedName name) {} | ||
|
||
@Override | ||
protected DataTarget writePropertyImpl(QualifiedName name) { | ||
return new DiscardingDataTarget(); | ||
} | ||
|
||
@Override | ||
protected DataTarget writeContentImpl() { | ||
return new DiscardingDataTarget(); | ||
} | ||
|
||
@Override | ||
protected void endChildImpl() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters