private void handleEndElement(EndElement event) throws SAXException {
if(!seenText && predictor.expectText()) {
visitor.text("");
}
// fire endElement
QName qName = event.getName();
tagName.uri = fixNull(qName.getNamespaceURI());
tagName.local = qName.getLocalPart();
visitor.endElement(tagName);
// end namespace bindings
for( Iterator<Namespace> i = event.getNamespaces(); i.hasNext();) {
String prefix = fixNull(i.next().getPrefix()); // be defensive
visitor.endPrefixMapping(prefix);
}
seenText = false;
}
java类javax.xml.stream.events.EndElement的实例源码
StAXEventConnector.java 文件源码
项目:OpenJSharp
阅读 26
收藏 0
点赞 0
评论 0
StAXEventConnector.java 文件源码
项目:openjdk-jdk10
阅读 26
收藏 0
点赞 0
评论 0
private void handleEndElement(EndElement event) throws SAXException {
if(!seenText && predictor.expectText()) {
visitor.text("");
}
// fire endElement
QName qName = event.getName();
tagName.uri = fixNull(qName.getNamespaceURI());
tagName.local = qName.getLocalPart();
visitor.endElement(tagName);
// end namespace bindings
for( Iterator<Namespace> i = event.getNamespaces(); i.hasNext();) {
String prefix = fixNull(i.next().getPrefix()); // be defensive
visitor.endPrefixMapping(prefix);
}
seenText = false;
}
StAXEventConnector.java 文件源码
项目:openjdk9
阅读 23
收藏 0
点赞 0
评论 0
private void handleEndElement(EndElement event) throws SAXException {
if(!seenText && predictor.expectText()) {
visitor.text("");
}
// fire endElement
QName qName = event.getName();
tagName.uri = fixNull(qName.getNamespaceURI());
tagName.local = qName.getLocalPart();
visitor.endElement(tagName);
// end namespace bindings
for( Iterator<Namespace> i = event.getNamespaces(); i.hasNext();) {
String prefix = fixNull(i.next().getPrefix()); // be defensive
visitor.endPrefixMapping(prefix);
}
seenText = false;
}
StaxEventXMLReader.java 文件源码
项目:spring4-understanding
阅读 22
收藏 0
点赞 0
评论 0
private void handleEndElement(EndElement endElement) throws SAXException {
if (getContentHandler() != null) {
QName qName = endElement.getName();
if (hasNamespacesFeature()) {
getContentHandler().endElement(qName.getNamespaceURI(), qName.getLocalPart(), toQualifiedName(qName));
for (Iterator i = endElement.getNamespaces(); i.hasNext();) {
Namespace namespace = (Namespace) i.next();
endPrefixMapping(namespace.getPrefix());
}
}
else {
getContentHandler().endElement("", "", toQualifiedName(qName));
}
}
}
StAXEventConnector.java 文件源码
项目:lookaside_java-1.8.0-openjdk
阅读 25
收藏 0
点赞 0
评论 0
private void handleEndElement(EndElement event) throws SAXException {
if(!seenText && predictor.expectText()) {
visitor.text("");
}
// fire endElement
QName qName = event.getName();
tagName.uri = fixNull(qName.getNamespaceURI());
tagName.local = qName.getLocalPart();
visitor.endElement(tagName);
// end namespace bindings
for( Iterator<Namespace> i = event.getNamespaces(); i.hasNext();) {
String prefix = fixNull(i.next().getPrefix()); // be defensive
visitor.endPrefixMapping(prefix);
}
seenText = false;
}
StaxEventXMLReader.java 文件源码
项目:spring
阅读 25
收藏 0
点赞 0
评论 0
private void handleEndElement(EndElement endElement) throws SAXException {
if (getContentHandler() != null) {
QName qName = endElement.getName();
if (hasNamespacesFeature()) {
getContentHandler().endElement(qName.getNamespaceURI(), qName.getLocalPart(), toQualifiedName(qName));
for (Iterator i = endElement.getNamespaces(); i.hasNext();) {
Namespace namespace = (Namespace) i.next();
endPrefixMapping(namespace.getPrefix());
}
}
else {
getContentHandler().endElement("", "", toQualifiedName(qName));
}
}
}
EntityRepository.java 文件源码
项目:JavaMainRepo
阅读 22
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
StAXEventConnector.java 文件源码
项目:infobip-open-jdk-8
阅读 22
收藏 0
点赞 0
评论 0
private void handleEndElement(EndElement event) throws SAXException {
if(!seenText && predictor.expectText()) {
visitor.text("");
}
// fire endElement
QName qName = event.getName();
tagName.uri = fixNull(qName.getNamespaceURI());
tagName.local = qName.getLocalPart();
visitor.endElement(tagName);
// end namespace bindings
for( Iterator<Namespace> i = event.getNamespaces(); i.hasNext();) {
String prefix = fixNull(i.next().getPrefix()); // be defensive
visitor.endPrefixMapping(prefix);
}
seenText = false;
}
AnimalRepository.java 文件源码
项目:JavaMainRepo
阅读 20
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
TmxReader2.java 文件源码
项目:tmpotter
阅读 20
收藏 0
点赞 0
评论 0
/**
* Parse prop elements in Header.
*
* @param element XML element.
* @throws Exception when error happend.
*/
private void parseHeaderProp(StartElement element) throws Exception {
String propType = getAttributeValue(element, "type");
StringBuilder headerPropContent = new StringBuilder();
while (true) {
XMLEvent evt = xml.nextEvent();
switch (evt.getEventType()) {
case XMLEvent.END_ELEMENT:
EndElement eleEnd = (EndElement) evt;
if ("prop".equals(eleEnd.getName().getLocalPart())) {
header.props.put(propType, headerPropContent.toString());
return;
}
break;
case XMLEvent.CHARACTERS:
Characters ch = (Characters) evt;
headerPropContent.append(ch.getData());
break;
default:
break;
}
}
}
TmxReader2.java 文件源码
项目:tmpotter
阅读 31
收藏 0
点赞 0
评论 0
private void parseHeaderNote(StartElement element) throws Exception {
noteContent.setLength(0);
while (true) {
XMLEvent evt = xml.nextEvent();
switch (evt.getEventType()) {
case XMLEvent.END_ELEMENT:
EndElement eleEnd = (EndElement) evt;
if ("note".equals(eleEnd.getName().getLocalPart())) {
header.note = noteContent.toString();
return;
}
break;
case XMLEvent.CHARACTERS:
Characters ch = (Characters) evt;
noteContent.append(ch.getData());
break;
default:
break;
}
}
}
EmployeeRepository.java 文件源码
项目:JavaMainRepo
阅读 21
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
TmxReader2.java 文件源码
项目:tmpotter
阅读 30
收藏 0
点赞 0
评论 0
private void parseTuNote(StartElement element) throws Exception {
noteContent.setLength(0);
while (true) {
XMLEvent evt = xml.nextEvent();
switch (evt.getEventType()) {
case XMLEvent.END_ELEMENT:
EndElement eleEnd = (EndElement) evt;
if ("note".equals(eleEnd.getName().getLocalPart())) {
currentTu.note = noteContent.toString();
return;
}
break;
case XMLEvent.CHARACTERS:
Characters ch = (Characters) evt;
noteContent.append(ch.getData());
break;
default:
break;
}
}
}
EntityRepository.java 文件源码
项目:JavaMainRepo
阅读 21
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
TmxReader2.java 文件源码
项目:tmpotter
阅读 22
收藏 0
点赞 0
评论 0
/**
* OmegaT TMX - just read full text.
*/
private void parseSegOmegaT() throws Exception {
segContent.setLength(0);
while (true) {
XMLEvent evt = xml.nextEvent();
switch (evt.getEventType()) {
case XMLEvent.END_ELEMENT:
EndElement eleEnd = (EndElement) evt;
if ("seg".equals(eleEnd.getName().getLocalPart())) {
return;
}
break;
case XMLEvent.CHARACTERS:
Characters ch = (Characters) evt;
segContent.append(ch.getData());
break;
default:
break;
}
}
}
EntityRepository.java 文件源码
项目:JavaMainRepo
阅读 27
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EmployeeRepository.java 文件源码
项目:JavaMainRepo
阅读 25
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EntityRepository.java 文件源码
项目:JavaMainRepo
阅读 31
收藏 0
点赞 0
评论 0
/**
*
* @param eventWriter
* .
* @param name
* The name.
* @param value
* The value.
* @throws XMLStreamException
* .
*/
public static void createNode(final XMLEventWriter eventWriter, final String name, final String value)
throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EntityRepository.java 文件源码
项目:JavaMainRepo
阅读 25
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EntityRepository.java 文件源码
项目:JavaMainRepo
阅读 19
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
AnimalRepository.java 文件源码
项目:JavaMainRepo
阅读 23
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EmployeeRepository.java 文件源码
项目:JavaMainRepo
阅读 27
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
AnimalRepository.java 文件源码
项目:JavaMainRepo
阅读 21
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create end node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EmployeeRepository.java 文件源码
项目:JavaMainRepo
阅读 27
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create end node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EntityRepository.java 文件源码
项目:JavaMainRepo
阅读 25
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create end node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
AnimalRepository.java 文件源码
项目:JavaMainRepo
阅读 23
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EmployeeRepository.java 文件源码
项目:JavaMainRepo
阅读 24
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
AnimalRepository.java 文件源码
项目:JavaMainRepo
阅读 17
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EmployeeRepository.java 文件源码
项目:JavaMainRepo
阅读 19
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}
EntityRepository.java 文件源码
项目:JavaMainRepo
阅读 20
收藏 0
点赞 0
评论 0
public static void createNode(XMLEventWriter eventWriter, String name, String value) throws XMLStreamException {
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
XMLEvent end = eventFactory.createDTD("\n");
XMLEvent tab = eventFactory.createDTD("\t");
// Create Start node
StartElement sElement = eventFactory.createStartElement("", "", name);
eventWriter.add(tab);
eventWriter.add(sElement);
// Create Content
Characters characters = eventFactory.createCharacters(value);
eventWriter.add(characters);
// Create End node
EndElement eElement = eventFactory.createEndElement("", "", name);
eventWriter.add(eElement);
eventWriter.add(end);
}