|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.brunchboy.util.swing.relativelayout.XmlConstraintBuilder
A helper class providing the ability to add constraints to a
RelativeLayout by parsing XML definition files.
| Nested Class Summary | |
static class |
XmlConstraintBuilder.ParseException
An exception subclass with which we'll wrap any exceptions thrown in parsing the constraints specifications, to shield our clients from details about the libraries we use, unless they want to know about them. |
| Field Summary | |
static String |
CONSTRAINT_SET_DTD_PUBLIC
The public identifier by which our constraint-set DTD can be resolved. |
static String |
CONSTRAINT_SET_DTD_SYSTEM
The system identifier by which our constraint-set DTD is loaded. |
static String |
VERSION
Provides access to the CVS version of this class. |
| Constructor Summary | |
XmlConstraintBuilder()
Sets up the necessary resources for parsing XML specifications. |
|
| Method Summary | |
protected void |
addComponentConstraint(String component,
Element constraint,
RelativeLayout layout)
Utility method called once we have the element corresponding to a constraint that needs to be created. |
protected void |
addConstraints(Document document,
RelativeLayout layout)
Utility method to do the work of walking the document tree generated by parsing the supplied XML constraint specifications, and turning these into actual constraints to be added to the layout. |
void |
addConstraints(File file,
RelativeLayout layout)
Add constraints parsed from a file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String VERSION
public static final String CONSTRAINT_SET_DTD_PUBLIC
public static final String CONSTRAINT_SET_DTD_SYSTEM
| Constructor Detail |
public XmlConstraintBuilder()
| Method Detail |
protected void addComponentConstraint(String component,
Element constraint,
RelativeLayout layout)
throws DataConversionException,
XmlConstraintBuilder.ParseException
component - the name of the component being constrained.constraint - the XML element representing the constraint.layout - the layout to which the constraints should be added.
DataConversionException - if there's a problem parsing an
attribute.
XmlConstraintBuilder.ParseException - if there's a problem parsing the
constraint.
XmlConstraintBuilder.ParseException
protected void addConstraints(Document document,
RelativeLayout layout)
throws DataConversionException,
XmlConstraintBuilder.ParseException
document - the parsed constraint document.layout - the layout to which the constraints should be added.
DataConversionException - if there's a problem parsing an
attribute.
XmlConstraintBuilder.ParseException - if there's a problem parsing the
constraint.
XmlConstraintBuilder.ParseException
public void addConstraints(File file,
RelativeLayout layout)
throws XmlConstraintBuilder.ParseException
file - the file containing XML constraint specifications.layout - the layout to which the parsed constraints should be
added.
XmlConstraintBuilder.ParseException - if there is a problem parsing the constraints.
XmlConstraintBuilder.ParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||