event2 = parser.nextEvent();
if(!event2.isCharacters()){
System.out.println("incorrcet configuration file format!");
return;
}
Characters characters = event2.asCharacters();
if(characters.isWhiteSpace()){
System.out.println("incorrcet configuration file format!");
return;
}
type = characters.getData().toUpperCase();
}
if(element2.getName().toString().equalsIgnoreCase("name")){
event2 = parser.nextEvent();
if(!event2.isCharacters()){
System.out.println("incorrcet configuration file format!");
return;
}
Characters characters = event2.asCharacters();
if(characters.isWhiteSpace()){
System.out.println("incorrcet configuration file format!");
return;
}
name = characters.getData().trim();
}
if(element2.getName().toString().equalsIgnoreCase("host")){
event2 = parser.nextEvent();
if(!event2.isCharacters()){
System.out.println("incorrcet configuration file format!");
return;
}
Characters characters = event2.asCharacters();
if(characters.isWhiteSpace()){
System.out.println("incorrcet configuration file format!");
return;
}
host = characters.getData().trim();
}
if(element2.getName().toString().equalsIgnoreCase("port")){
event2 = parser.nextEvent();
if(!event2.isCharacters()){
System.out.println("incorrcet configuration file format!");
return;
}
Characters characters = event2.asCharacters();
if(characters.isWhiteSpace()){
System.out.println("incorrcet configuration file format!");
return;
}
port = characters.getData().trim();
}
}
else if (event2.getEventType() == XMLStreamConstants.END_ELEMENT){
EndElement element3 = event2.asEndElement();