本文整理汇总了Java中org.codehaus.jettison.json.JSONException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java JSONException.printStackTrace方法的具体用法?Java JSONException.printStackTrace怎么用?Java JSONException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.jettison.json.JSONException
的用法示例。
在下文中一共展示了JSONException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEvents
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
public Map<String, IonEvent> getEvents() {
Map<String, IonEvent> events = new HashMap<String, IonEvent>();
try {
JSONObject jsonEvents = jsonBean.getJSONObject(Key.events.name());
@SuppressWarnings("unchecked")
Iterator<String> it = jsonEvents.keys();
while (it.hasNext()) {
String pkey = it.next();
if (!pkey.isEmpty()) {
Object ob = jsonEvents.get(pkey);
if (ob instanceof JSONObject) {
IonEvent event = new IonEvent((JSONObject)ob);
event.setName(pkey);
events.put(event.getName(), event);
}
}
}
} catch (JSONException e) {
e.printStackTrace();
}
return events;
}
示例2: readPropertyModels
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
private void readPropertyModels(JSONObject root) {
try {
JSONObject props = root.getJSONObject("Props");
@SuppressWarnings("unchecked")
Iterator<String> it = props.keys();
while (it.hasNext()) {
String key = it.next();
if (!key.isEmpty()) {
IonProperty property = new IonProperty(props.getJSONObject(key));
property.setName(key);
pCache.put(key, property);
}
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例3: getProperties
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
public Map<String, IonProperty> getProperties() {
Map<String, IonProperty> properties = new HashMap<String, IonProperty>();
try {
JSONObject jsonProperties = jsonBean.getJSONObject(Key.properties.name());
@SuppressWarnings("unchecked")
Iterator<String> it = jsonProperties.keys();
while (it.hasNext()) {
String pkey = it.next();
if (!pkey.isEmpty()) {
Object ob = jsonProperties.get(pkey);
if (ob instanceof JSONObject) {
IonProperty property = new IonProperty((JSONObject)ob);
property.setName(pkey);
properties.put(property.getName(), property);
}
}
}
} catch (JSONException e) {
e.printStackTrace();
}
return properties;
}
示例4: setValue
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
public void setValue(Object value) {
try {
jsonProperty.put(Key.value.name(), value);
} catch (JSONException e) {
e.printStackTrace();
}
}
示例5: isComposite
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
public boolean isComposite() {
try {
return jsonProperty.getBoolean(Key.composite.name());
} catch (JSONException e) {
e.printStackTrace();
return false;
}
}
示例6: writeXml
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
@Override
public Node writeXml(Document document) throws Exception {
Element self = document.createElement(getClass().getSimpleName());
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("mode", mode.name().toLowerCase());
jsonObject.put("value", getSmartValue());
} catch (JSONException e) {
e.printStackTrace();
}
self.setTextContent(jsonObject.toString());
return self;
}
示例7: getDescription
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
public String getDescription() {
try {
return jsonBean.getString(Key.description.name());
} catch (JSONException e) {
e.printStackTrace();
return "description";
}
}
示例8: setName
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
protected void setName(String name) {
try {
jsonBean.put(Key.name.name(), name);
} catch (JSONException e) {
e.printStackTrace();
}
}
示例9: getCategory
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
public String getCategory() {
try {
return jsonProperty.getString(Key.category.name());
} catch (JSONException e) {
e.printStackTrace();
return "category";
}
}
示例10: IonConfig
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
public IonConfig(JSONObject jsonOb) {
this();
for (Key k: Key.values()) {
if (jsonOb.has(k.name())) {
try {
jsonConfig.put(k.name(), jsonOb.get(k.name()));
} catch (JSONException e) {
e.printStackTrace();
}
}
}
}
示例11: getComputedStyle
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
public String getComputedStyle() {
try {
return getComputedContents().getString("style");
} catch (JSONException e) {
e.printStackTrace();
}
return "";
}
示例12: getIcon16
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
public String getIcon16() {
try {
return jsonBean.getString(Key.icon16.name());
} catch (JSONException e) {
e.printStackTrace();
return "default_color_16x16.png";
}
}
示例13: initJsonComputed
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
private JSONObject initJsonComputed() {
JSONObject jsonObject = null;
try {
jsonObject = new JSONObject()
.put("style", "")
.put("theme", "")
.put("route", "")
.put("template", "");
} catch (JSONException e) {
e.printStackTrace();
}
return jsonObject;
}
示例14: doComputeContents
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
protected synchronized void doComputeContents() {
try {
JSONObject newComputedContent = initJsonComputed();
newComputedContent.put("style", computeStyle());
newComputedContent.put("theme", computeTheme());
newComputedContent.put("route", computeRoute());
newComputedContent.put("template", computeTemplate());
computedContents = newComputedContent;
} catch (JSONException e) {
e.printStackTrace();
}
}
示例15: indexOntology
import org.codehaus.jettison.json.JSONException; //导入方法依赖的package包/类
@POST
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
public Response indexOntology(IndexingJobInput input){
ResponseBuilder responseBuilder = null;
try {
String jid = ontonetHub.indexOntology(input);
URI location = URI.create(getPublicBaseUri() + "jobs/" + jid);
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("monitoringService", location.toString());
jsonObject.put("ontologyId", jid);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
responseBuilder = Response.ok(jsonObject.toString());
} catch (OntologyAlreadyExistingException e1) {
responseBuilder = Response.status(Status.CONFLICT);
}
return responseBuilder.build();
}