Skip to content

Commit e4c1115

Browse files
committed
feat: introduce XMLFilterImplRefinements interface for state-based XML filter refinement strategies
1 parent 1cc04e6 commit e4c1115

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package com.barista.xmlfilterimpl;
2+
3+
import org.xml.sax.InputSource;
4+
import org.xml.sax.XMLReader;
5+
6+
import liquidjava.specification.StateSet;
7+
import liquidjava.specification.StateRefinement;
8+
import liquidjava.specification.ExternalRefinementsFor;
9+
10+
@StateSet({"parentless", "withparent"})
11+
@ExternalRefinementsFor("org.xml.sax.helpers.XMLFilterImpl")
12+
public interface XMLFilterImplRefinements {
13+
// Constructors
14+
@StateRefinement(to="parentless(this)")
15+
public void XMLFilterImpl();
16+
17+
@StateRefinement(to="withparent(this)")
18+
public void XMLFilterImpl(XMLReader parent);
19+
20+
// Methods
21+
@StateRefinement(from="parentless(this) || withparent(this)", to="withparent(this)")
22+
public void setParent(XMLReader parent);
23+
24+
@StateRefinement(from="withparent(this)", to="withparent(this)")
25+
public void setProperty(String name, Object value);
26+
27+
@StateRefinement(from="withparent(this)", to="withparent(this)")
28+
public Object getProperty(String name);
29+
30+
@StateRefinement(from="withparent(this)", to="withparent(this)")
31+
public void setFeature(String name, boolean value);
32+
33+
@StateRefinement(from="withparent(this)", to="withparent(this)")
34+
public boolean getFeature(String name);
35+
36+
@StateRefinement(from="withparent(this)", to="withparent(this)")
37+
public void parse(InputSource input);
38+
39+
@StateRefinement(from="withparent(this)", to="withparent(this)")
40+
public void parse(String systemId);
41+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.barista.xmlfilterimpl;
2+
3+
import org.xml.sax.SAXNotRecognizedException;
4+
import org.xml.sax.SAXNotSupportedException;
5+
import org.xml.sax.helpers.XMLFilterImpl;
6+
7+
public class XMLFilterImplTest {
8+
9+
public void test1() throws SAXNotRecognizedException, SAXNotSupportedException {
10+
XMLFilterImpl xml = new XMLFilterImpl();
11+
xml.setProperty("key", null);
12+
}
13+
14+
public void test2() throws SAXNotRecognizedException, SAXNotSupportedException {
15+
XMLFilterImpl xml = new XMLFilterImpl(null);
16+
xml.setProperty("key", null);
17+
}
18+
}

0 commit comments

Comments
 (0)