本文整理匯總了Java中org.jdom2.JDOMException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java JDOMException.printStackTrace方法的具體用法?Java JDOMException.printStackTrace怎麽用?Java JDOMException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jdom2.JDOMException
的用法示例。
在下文中一共展示了JDOMException.printStackTrace方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: reload
import org.jdom2.JDOMException; //導入方法依賴的package包/類
private void reload(Sender sender) {
if (!sender.hasPermission("arcade.command.reload")) {
throw new CommandPermissionException("arcade.command.reload");
}
Settings settings = this.plugin.getSettings();
sender.sendInfo("Reloading settings file...");
try {
settings.setDocument(settings.readSettingsFile());
this.plugin.getEventBus().publish(new SettingsReloadEvent(this.plugin, settings));
sender.sendSuccess("Successfully reloaded settings file. Well done!");
} catch (IOException io) {
io.printStackTrace();
throw new CommandException("Could not reload settings file: " + io.getMessage());
} catch (JDOMException jdom) {
jdom.printStackTrace();
throw new CommandException("Could not reload XML file: " + jdom.getMessage());
}
}
示例2: readDBConfig
import org.jdom2.JDOMException; //導入方法依賴的package包/類
/**
* read mysql table configuration file (this configuration is needed only when the persistent
* style is MySQL)
* @param filePath
* @param db
* @param table
* @return
*/
public static Map<String, List<String>> readDBConfig(String filePath, String db, String table) {
Map<String, List<String>> res = new HashMap<String, List<String>>();
List<String> col_names = new ArrayList<String>();
List<String> col_types = new ArrayList<String>();
try {
SAXBuilder builder = new SAXBuilder();
Document document = builder.build(filePath);
Element root = document.getRootElement();
List<Element> items = root.getChildren();
for(Element db_ele : items) {
if(db_ele.getAttributeValue("name").equals(db)) {
items = db_ele.getChildren();
break;
}
}
for(Element table_ele : items) {
if(table_ele.getAttributeValue("name").equals(table)) {
items = table_ele.getChildren();
break;
}
}
for(Element col_ele : items) {
col_names.add(col_ele.getValue().split(" ")[0]);
col_types.add(col_ele.getValue().split(" ")[1]);
}
res.put("names", col_names);
res.put("types", col_types);
} catch(IOException ioe) {
ioe.printStackTrace();
} catch(JDOMException jde) {
jde.printStackTrace();
}
return res;
}
示例3: parseMapXml
import org.jdom2.JDOMException; //導入方法依賴的package包/類
private void parseMapXml() {
for (Element xml : this.getSettings().getChildren()) {
try {
// factory
LeakableFactory factory = this.getFactory(xml.getName());
if (factory == null) {
continue;
}
// id
String id = xml.getAttributeValue("id");
if (id == null || id.trim().isEmpty()) {
continue;
}
// owner
String ownerId = xml.getAttributeValue("owner");
GoalHolder owner = null;
if (ownerId != null && !ownerId.trim().isEmpty()) {
owner = this.getMatch().findWinnerById(ownerId.trim());
}
// name
String name = xml.getAttributeValue("name");
if (name != null) {
name = name.trim();
}
// object
Leakable leakable = factory.newLeakable(this, owner, id.trim(), name, xml);
if (leakable == null) {
continue;
}
leakable.setName(name);
this.addLeakable(leakable);
// register
if (leakable.registerGoal()) {
for (GoalHolder completableBy : this.match.getWinnerList()) {
if (leakable.isCompletableBy(completableBy)) {
completableBy.addGoal(leakable);
}
}
}
leakable.registerEventListeners(this, true); // register listeners
} catch (JDOMException ex) {
ex.printStackTrace();
}
}
}
示例4: parseMapXml
import org.jdom2.JDOMException; //導入方法依賴的package包/類
private void parseMapXml() {
for (Element xml : this.getSettings().getChildren()) {
try {
// factory
CapturableFactory factory = this.getFactory(xml.getName());
if (factory == null) {
continue;
}
// id
String id = xml.getAttributeValue("id");
if (id == null || id.trim().isEmpty()) {
continue;
}
// owner
String ownerId = xml.getAttributeValue("owner");
GoalHolder owner = null;
if (ownerId != null && !ownerId.trim().isEmpty()) {
owner = this.getMatch().findWinnerById(ownerId.trim());
}
// name
String name = xml.getAttributeValue("name");
if (name != null) {
name = name.trim();
}
// object
Capturable capturable = factory.newCapturable(this, owner, id.trim(), name, xml);
if (capturable == null) {
continue;
}
capturable.setName(name);
this.addCapturable(capturable);
// register
if (capturable.registerGoal()) {
for (MatchWinner winner : this.getMatch().getWinnerList()) {
if (capturable.isCompletableBy(winner)) {
winner.addGoal(capturable);
}
}
}
capturable.registerEventListeners(this, true); // register listeners
} catch (JDOMException ex) {
ex.printStackTrace();
}
}
}