本文整理匯總了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();
}