/** * Read the contents of the characters between the specified XML * element tags, if the read is currently at that element. This * allows characters associated with the element to be used. If * the specified node is not the current node, null is returned. * * @param from this is the input node to read the value from * * @return this returns the characters from the specified node */ private String readText(InputNode from) throws Exception { EventNode event = reader.peek(); while(stack.top() == from) { if(event.isText()) { fillText(from); } else { break; } event = reader.next(); event = reader.peek(); } return readBuffer(from); }
/** * Read the contents of the characters between the specified XML * element tags, if the read is currently at that element. This * allows characters associated with the element to be used. If * the specified node is not the current node, null is returned. * * @param from this is the input node to read the value from * * @return this returns the characters from the specified node */ private void fillText(InputNode from) throws Exception { EventNode event = reader.peek(); if(event.isText()) { String data = event.getValue(); text.append(data); } }
/** * Returns the next input node from the XML document, if it is a * child element of the specified input node. This essentially * determines whether the end tag has been read for the specified * node, if so then null is returned. If however the specified * node has not had its end tag read then this returns the next * element, if that element is a child of the that node. * * @param from this is the input node to read with * * @return this returns the next input node from the document */ public InputNode readElement(InputNode from) throws Exception { if(!stack.isRelevant(from)) { return null; } EventNode event = reader.next(); while(event != null) { if(event.isEnd()) { if(stack.pop() == from) { return null; } } else if(event.isStart()) { return readStart(from, event); } event = reader.next(); } return null; }
/** * Read the contents of the characters between the specified XML * element tags, if the read is currently at that element. This * allows characters associated with the element to be used. If * the specified node is not the current node, null is returned. * * @param from this is the input node to read the value from * * @return this returns the characters from the specified node */ private void fillText(InputNode from) throws Exception { EventNode event = reader.peek(); if(event.isText()) { String data = event.getValue(); text.append(data); } }
/** * Returns the next input node from the XML document, if it is a * child element of the specified input node. This essentially * determines whether the end tag has been read for the specified * node, if so then null is returned. If however the specified * node has not had its end tag read then this returns the next * element, if that element is a child of the that node. * * @param from this is the input node to read with * * @return this returns the next input node from the document */ public InputNode readElement(InputNode from) throws Exception { if(!stack.isRelevant(from)) { return null; } EventNode event = reader.next(); while(event != null) { if(event.isEnd()) { if(stack.pop() == from) { return null; } } else if(event.isStart()) { return readStart(from, event); } event = reader.next(); } return null; }
/** * Read the contents of the characters between the specified XML * element tags, if the read is currently at that element. This * allows characters associated with the element to be used. If * the specified node is not the current node, null is returned. * * @param from this is the input node to read the value from * * @return this returns the characters from the specified node */ private String readText(InputNode from) throws Exception { EventNode event = reader.peek(); while(stack.top() == from) { if(event.isText()) { fillText(from); } else { break; } event = reader.next(); event = reader.peek(); } return readBuffer(from); }
/** * Read the contents of the characters between the specified XML * element tags, if the read is currently at that element. This * allows characters associated with the element to be used. If * the specified node is not the current node, null is returned. * * @param from this is the input node to read the value from * * @return this returns the characters from the specified node */ private void fillText(InputNode from) throws Exception { EventNode event = reader.peek(); if(event.isText()) { String data = event.getValue(); text.append(data); } }
/** * Returns the next input node from the XML document, if it is a * child element of the specified input node. This essentially * determines whether the end tag has been read for the specified * node, if so then null is returned. If however the specified * node has not had its end tag read then this returns the next * element, if that element is a child of the that node. * * @param from this is the input node to read with * * @return this returns the next input node from the document */ public InputNode readElement(InputNode from) throws Exception { if(!stack.isRelevant(from)) { return null; } EventNode event = reader.next(); while(event != null) { if(event.isEnd()) { if(stack.pop() == from) { return null; } } else if(event.isStart()) { return readStart(from, event); } event = reader.next(); } return null; }
/** * Read the contents of the characters between the specified XML * element tags, if the read is currently at that element. This * allows characters associated with the element to be used. If * the specified node is not the current node, null is returned. * * @param from this is the input node to read the value from * * @return this returns the characters from the specified node */ private String readText(InputNode from) throws Exception { EventNode event = reader.peek(); while(stack.top() == from) { if(event.isText()) { fillText(from); } else { break; } event = reader.next(); event = reader.peek(); } return readBuffer(from); }
/** * This is used to determine if this input node is empty. An * empty node is one with no attributes or children. This can * be used to determine if a given node represents an empty * entity, with which no extra data can be extracted. * * @param from this is the input node to read the value from * * @return this returns true if the node is an empty element * * @throws Exception thrown if there was a parse error */ public boolean isEmpty(InputNode from) throws Exception { if(stack.top() == from) { EventNode event = reader.peek(); if(event.isEnd()) { return true; } } return false; }
/** * Read the contents of the characters between the specified XML * element tags, if the read is currently at that element. This * allows characters associated with the element to be used. If * the specified node is not the current node, null is returned. * * @param from this is the input node to read the value from * * @return this returns the characters from the specified node */ public String readValue(InputNode from) throws Exception { if(!stack.isRelevant(from)) { return null; } int length = text.length(); if(length <= 0) { EventNode event = reader.peek(); if(event.isEnd()) { if(stack.top() == from) { return null; } else { stack.pop(); } event = reader.next(); } } return readText(from); }
/** * This is used to determine if this input node is empty. An * empty node is one with no attributes or children. This can * be used to determine if a given node represents an empty * entity, with which no extra data can be extracted. * * @param from this is the input node to read the value from * * @return this returns true if the node is an empty element * * @throws Exception thrown if there was a parse error */ public boolean isEmpty(InputNode from) throws Exception { if(stack.top() == from) { EventNode event = reader.peek(); if(event.isEnd()) { return true; } } return false; }
/** * Read the contents of the characters between the specified XML * element tags, if the read is currently at that element. This * allows characters associated with the element to be used. If * the specified node is not the current node, null is returned. * * @param from this is the input node to read the value from * * @return this returns the characters from the specified node */ public String readValue(InputNode from) throws Exception { if(!stack.isRelevant(from)) { return null; } int length = text.length(); if(length <= 0) { EventNode event = reader.peek(); if(event.isEnd()) { if(stack.top() == from) { return null; } else { stack.pop(); } event = reader.next(); } } return readText(from); }
/** * This is used to determine if this input node is empty. An * empty node is one with no attributes or children. This can * be used to determine if a given node represents an empty * entity, with which no extra data can be extracted. * * @param from this is the input node to read the value from * * @return this returns true if the node is an empty element * * @throws Exception thrown if there was a parse error */ public boolean isEmpty(InputNode from) throws Exception { if(stack.top() == from) { EventNode event = reader.peek(); if(event.isEnd()) { return true; } } return false; }
/** * Read the contents of the characters between the specified XML * element tags, if the read is currently at that element. This * allows characters associated with the element to be used. If * the specified node is not the current node, null is returned. * * @param from this is the input node to read the value from * * @return this returns the characters from the specified node */ public String readValue(InputNode from) throws Exception { if(!stack.isRelevant(from)) { return null; } int length = text.length(); if(length <= 0) { EventNode event = reader.peek(); if(event.isEnd()) { if(stack.top() == from) { return null; } else { stack.pop(); } event = reader.next(); } } return readText(from); }