@Override public void writeURIAttribute(String name, Object value, String property) throws IOException { currentRecord.addAttribute(new URIAttribute(name, value, property)); }
@Override public void startElement(String name, UIComponent component) throws IOException { currentRecord = currentRecord.addRecord(new ElementRecord(name,component)); }
@Override public void endElement(String name) throws IOException { if(!(currentRecord instanceof ElementRecord)){ throw new FacesTestException("End element does not match start element call"); } if(!name.equals(currentRecord.getName())){ throw new FacesTestException("End ("+name+") element does not match current element "+currentRecord.getName()); } currentRecord = currentRecord.getParent(); }
@Override public void endCDATA() throws IOException { if(currentRecord instanceof CDATARecord){ currentRecord = currentRecord.getParent(); } else { throw new FacesTestException("End CDATA does not match startCDATA "); } } /* (non-Javadoc)
public Record addRecord(Record next) { next.setParent(this); records.add(next); return next; }
public String getText() { StringBuilder text = new StringBuilder(); for (Record record : records) { text.append(record.getText()); } return text.toString(); }
for (Record childRecord : record.getChildren()) { result.addAll(lookup(childRecord, level + 1,childPosition)); if (childRecord instanceof ElementRecord) { for (Record childRecord : record.getChildren()) { result.addAll(lookup(childRecord, level,currentPosition)); if (childRecord instanceof ElementRecord) {
@Override public void endDocument() throws IOException { if(!(currentRecord instanceof DocumentRecord)){ throw new FacesTestException("End document call does not match start document"); } currentRecord = currentRecord.getParent(); }
public Record addRecord(Record next) { next.setParent(this); records.add(next); return next; }
public String getText() { StringBuilder text = new StringBuilder(); for (Record record : records) { text.append(record.getText()); } return text.toString(); }
for (Record childRecord : record.getChildren()) { result.addAll(lookup(childRecord, level + 1,childPosition)); if (childRecord instanceof ElementRecord) { for (Record childRecord : record.getChildren()) { result.addAll(lookup(childRecord, level,currentPosition)); if (childRecord instanceof ElementRecord) {
@Override public void startElement(String name, UIComponent component) throws IOException { currentRecord = currentRecord.addRecord(new ElementRecord(name,component)); }
@Override public void endElement(String name) throws IOException { if(!(currentRecord instanceof ElementRecord)){ throw new FacesTestException("End element does not match start element call"); } if(!name.equals(currentRecord.getName())){ throw new FacesTestException("End ("+name+") element does not match current element "+currentRecord.getName()); } currentRecord = currentRecord.getParent(); }
@Override public void endCDATA() throws IOException { if(currentRecord instanceof CDATARecord){ currentRecord = currentRecord.getParent(); } else { throw new FacesTestException("End CDATA does not match startCDATA "); } } /* (non-Javadoc)
@Override public void writeAttribute(String name, Object value, String property) throws IOException { currentRecord.addAttribute(new Attribute(name, value, property)); }
@Override public void writeComment(Object comment) throws IOException { currentRecord.addRecord(new CommentRecord(comment)); }
@Override public void endDocument() throws IOException { if(!(currentRecord instanceof DocumentRecord)){ throw new FacesTestException("End document call does not match start document"); } currentRecord = currentRecord.getParent(); }
@Override public void writeAttribute(String name, Object value, String property) throws IOException { currentRecord.addAttribute(new Attribute(name, value, property)); }
@Override public void startCDATA() throws IOException { currentRecord = currentRecord.addRecord(new CDATARecord()); }
@Override public void writeURIAttribute(String name, Object value, String property) throws IOException { currentRecord.addAttribute(new URIAttribute(name, value, property)); }