|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dk.brics.jwig.analysis.summarygraph.Template
XML template (document with gaps).
Field Summary | |
static int |
DIAMOND
Used for radio buttons. |
static int |
ONE
One occurence. |
static int |
STAR
Unknown number of occurences. |
static int |
ZERO
Zero occurences. |
Constructor Summary | |
Template(List xml)
Constructs a new Template from JDOM tree. |
|
Template(String str,
URL context,
String default_namespace)
Constructs a new Template from a string. |
Method Summary | |
void |
fixAnchors()
Inserts href attributes in all a elements
that have a submit attribute and removes the submit attribute and also
the status attribute, if present. |
void |
fixForms()
Inserts action attributes in all form elements
that do not have either a normal attribute or a gap attribute named action . |
Set |
getAttributeGaps()
Returns set of attribute gap names. |
static String |
getGap(Attribute a)
Returns gap name of gap attribute. |
static String |
getGap(Element e)
Returns gap name of gap element. |
static Namespace |
getGapNamespace()
Returns namespace for gap elements and attributes. |
Set |
getTemplateGaps()
Returns set of template gap names. |
List |
getXML()
Returns list of JDOM XML content nodes. |
List |
inFields(Set open,
String action)
Returns field count map for each form that has an action attribute with the given value. |
List |
inGaps(String action)
Returns gap count map for each form that has an action attribute with the given value. |
static boolean |
isGap(Attribute a)
Checks whether the given attribute represents a gap. |
static boolean |
isGap(Element e)
Checks whether the given element represents a gap. |
static Document |
makeDocument(String str,
URL context)
Builds an XML document from a String and expands XInclude and import instructions. |
static Document |
makeDocument(URL url)
Retrieves an XML document from a URL and expands XInclude and import instructions. |
HashMap |
outFields(Set open)
Returns field count map. |
HashMap |
outGaps()
Returns gap count map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DIAMOND
public static final int ONE
public static final int STAR
public static final int ZERO
Constructor Detail |
public Template(List xml)
Template
from JDOM tree.
It is assumed that XInclude and import instructions have been processed.
xml
- XML templatepublic Template(String str, URL context, String default_namespace) throws JDOMException, MalformedURLException
Template
from a string.
Builds an XML template from a String and expands XInclude and import instructions.
The namespace prefix sg
is set to the JWIG gap namespace URL.
The empty prefix is set to the given default namespace.
str
- XML template stringcontext
- URL context for resolving relative URLs (null if none)default_namespace
- initial default namespace
JDOMException
- if an error occured during JDOM parsing or XInclude/import expansion
MalformedURLException
- if a malformed URL appears in an XInclude/import instructionMethod Detail |
public void fixAnchors()
href
attributes in all a
elements
that have a submit attribute and removes the submit attribute and also
the status attribute, if present.
public void fixForms()
action
attributes in all form
elements
that do not have either a normal attribute or a gap attribute named action
.
public Set getAttributeGaps()
public static String getGap(Attribute a)
public static String getGap(Element e)
public static Namespace getGapNamespace()
public Set getTemplateGaps()
public List getXML()
public List inFields(Set open, String action)
open
- set of names of open gapsaction
- special value of JWIG form actions
ONE
,
STAR
, or DIAMOND
(ZERO
by default)public List inGaps(String action)
ONE
or STAR
(ZERO
by default)public static boolean isGap(Attribute a)
a
represents a gappublic static boolean isGap(Element e)
e
represents a gappublic static Document makeDocument(String str, URL context) throws JDOMException, MalformedURLException
str
- XML documentcontext
- URL context for resolving relative URLs (null if none)
JDOMException
- if an error occured during JDOM parsing or XInclude/import expansion
MalformedURLException
- if a malformed URL appears in an XInclude/import instructionpublic static Document makeDocument(URL url) throws JDOMException, MalformedURLException
url
- URL of XML document
JDOMException
- if an error occured during JDOM parsing or XInclude/import expansion
MalformedURLException
- if a malformed URL appears in an XInclude/import instructionpublic HashMap outFields(Set open)
open
- set of names of open gaps
ONE
, STAR
,
or DIAMOND
(ZERO
by default)public HashMap outGaps()
ONE
or STAR
(ZERO
by default)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |