public class BalancingMXMLProcessor extends Object
IMXMLTagData
objects. It looks for un-balanced MXML and attempts to
add open and close tags in order to create a well-formed, or better-formed, DOM.
The method used is to track tags by their depth, and going from inside out, to check for matches
add open/close tags if each depth isn't balanced. If a depth is unbalanced by close tags, the close tag is
promoted to its parent depth and dealt with at that levelConstructor and Description |
---|
BalancingMXMLProcessor(IFileSpecification specification,
Collection<ICompilerProblem> problems) |
Modifier and Type | Method and Description |
---|---|
void |
addCloseTag(IMXMLTagData closeTag,
int depth) |
void |
addOpenTag(IMXMLTagData openTag,
int depth) |
IMXMLUnitData[] |
balance(IMXMLUnitData[] data,
IMXMLData mxmlData,
Map<IMXMLTagData,PrefixMap> map) |
void |
initialize(IMXMLUnitData[] data)
Initialize our balancing structures from a full MXMLUnitData array.
|
void |
setFileSpecification(IFileSpecification specification) |
boolean |
wasRepaired()
Returns true if the balance operation resulted in a repaired document
|
public BalancingMXMLProcessor(IFileSpecification specification, Collection<ICompilerProblem> problems)
public void initialize(IMXMLUnitData[] data)
data
- the array to use to populate our balancing structurespublic final void setFileSpecification(IFileSpecification specification)
public IMXMLUnitData[] balance(IMXMLUnitData[] data, IMXMLData mxmlData, Map<IMXMLTagData,PrefixMap> map)
public boolean wasRepaired()
public void addOpenTag(IMXMLTagData openTag, int depth)
public void addCloseTag(IMXMLTagData closeTag, int depth)
Copyright © 2016 The Apache Software Foundation. All rights reserved.