Package org.javarosa.xform.util
Class XFormUtils
java.lang.Object
org.javarosa.xform.util.XFormUtils
public class XFormUtils extends Object
Static Utility methods pertaining to XForms.
- Author:
- Clayton Sims
-
Constructor Summary
Constructors Constructor Description XFormUtils() -
Method Summary
Modifier and Type Method Description static List<String>getAttributeList(org.kxml2.kdom.Element e)static FormDefgetFormFromFormXml(String formXmlSrc, String lastSavedSrc)static FormDefgetFormFromInputStream(InputStream is)Parses a form with an external secondary instance, and returns a FormDef.static FormDefgetFormFromInputStream(InputStream is, String lastSavedSrc)static FormDefgetFormFromResource(String resource)static FormDefgetFormFromSerializedResource(String resource)static FormDefgetFormRaw(InputStreamReader isr)static List<String>getUnusedAttributes(org.kxml2.kdom.Element e, List<String> usedAtts)static booleanisOutput(org.kxml2.kdom.Element e)Is this element an Output tag?static IXFormParserFactorysetXFormParserFactory(IXFormParserFactory factory)static booleanshowUnusedAttributeWarning(org.kxml2.kdom.Element e, List<String> usedAtts)static StringunusedAttWarning(org.kxml2.kdom.Element e, List<String> usedAtts)
-
Constructor Details
-
XFormUtils
public XFormUtils()
-
-
Method Details
-
setXFormParserFactory
-
getFormFromResource
-
getFormRaw
- Throws:
XFormParseExceptionIOException
-
getFormFromInputStream
Parses a form with an external secondary instance, and returns a FormDef.- Parameters:
is- the InputStream containing the form- Returns:
- a FormDef for the parsed form
- Throws:
XFormParseException- if the form can’t be parsed
-
getFormFromInputStream
public static FormDef getFormFromInputStream(InputStream is, String lastSavedSrc) throws XFormParseException- Parameters:
lastSavedSrc- The src of the last-saved instance of this form (for auto-filling). If null, no data will be loaded and the instance will be blank.- Throws:
XFormParseException- See Also:
getFormFromInputStream(InputStream)
-
getFormFromFormXml
public static FormDef getFormFromFormXml(String formXmlSrc, String lastSavedSrc) throws XFormParseException- Parameters:
formXmlSrc- The path to the XForm that is to be parsedlastSavedSrc- The src of the last-saved instance of this form (for auto-filling). If null, no data will be loaded and the instance will be blank.- Throws:
XFormParseException
-
getFormFromSerializedResource
-
getAttributeList
-
getUnusedAttributes
-
unusedAttWarning
-
showUnusedAttributeWarning
-
isOutput
public static boolean isOutput(org.kxml2.kdom.Element e)Is this element an Output tag?- Parameters:
e-- Returns:
-