Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //List-of XMLFragment
- interface LoIXMLFrag {}
- //List-of Attribute
- interface ILoAttribute {}
- interface IXMLFrag {}
- //Empty list of Attributes
- class MtAttribute implements ILoAttribute {
- MtAttribute() {}
- }
- //Non-empty list of Attributes
- class ConsAttribute implements ILoAttribute {
- Attribute first;
- ILoAttribute rest;
- public ConsAttribute(Attribute first, ILoAttribute rest) {
- this.first = first;
- this.rest = rest;
- }
- }
- class MtIXMLFrag implements LoIXMLFrag{
- MtIXMLFrag(){}
- }
- class ConsIXMLFrag implements LoIXMLFrag{
- IXMLFrag first;
- LoIXMLFrag rest;
- public ConsIXMLFrag(IXMLFrag first, LoIXMLFrag rest) {
- this.first = first;
- this.rest = rest;
- }
- }
- class Plaintext implements IXMLFrag {
- String txt;
- Plaintext(String txtString) {
- this.txt = txtString;
- }
- }
- class Attribute implements IXMLFrag {
- String name;
- String value;
- public Attribute(String name, String value) {
- this.name = name;
- this.value = value;
- }
- }
- class Tag implements IXMLFrag {
- String name;
- ILoAttribute atts;
- public Tag(String name, ILoAttribute atts) {
- this.name = name;
- this.atts = atts;
- }
- }
- class Tagged implements IXMLFrag {
- Tag tag;
- LoIXMLFrag content;
- public Tagged(Tag tag, LoIXMLFrag content) {
- this.tag = tag;
- this.content = content;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement