Package davmail.exchange.graph
Class GraphObject
java.lang.Object
davmail.exchange.graph.GraphObject
Wrapper for Graph API JsonObject
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.codehaus.jettison.json.JSONObjectprotected static final org.apache.log4j.Loggerprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringformatEmailAddress(org.codehaus.jettison.json.JSONObject jsonObject) booleangetBoolean(GraphField field) booleangetBoolean(String key) Compute recurrenceId property based on the original start and timezone.protected org.codehaus.jettison.json.JSONArrayGet a singleValueExtendedProperties JSON array.Get mandatory property value.protected StringbooleanoptBoolean(GraphField field) booleanoptBoolean(String key) Convert datetimetimezone to java date.intorg.codehaus.jettison.json.JSONArrayoptJSONArray(String key) org.codehaus.jettison.json.JSONObjectoptJSONObject(String key) optSectionString(String section, String key) Get optional parameter from JSON property.optString(GraphField field) Set the boolean value on the field defined by alias.Set value for alias.protected voidputSingleValueExtendedProperty(String key, Object value) Set or replace a single value extended property.voidsetCategories(String values) Set categories from comma separated values.voidsetCategories(String[] values) voidsetTaskImportanceFromVTodo(VObject vEvent) voidsetTaskStatusFromVTodo(VObject vEvent) toString(int indentFactor)
-
Field Details
-
LOGGER
protected static final org.apache.log4j.Logger LOGGER -
jsonObject
protected final org.codehaus.jettison.json.JSONObject jsonObject -
statusCode
protected int statusCode -
vTodoToTaskStatusMap
-
taskTovTodoStatusMap
-
importanceToPriorityMap
-
priorityToImportanceMap
-
-
Constructor Details
-
GraphObject
public GraphObject() -
GraphObject
public GraphObject(org.codehaus.jettison.json.JSONObject jsonObject)
-
-
Method Details
-
optString
-
optString
-
formatEmailAddress
-
getCalendarUid
-
optJSONArray
-
put
Set value for alias. First map property alias to a field to determine graph id, then set graph property or singleValueExtendedProperty- Parameters:
alias- field aliasvalue- property value- Throws:
org.codehaus.jettison.json.JSONException- on error
-
put
Set the boolean value on the field defined by alias. First map property alias to a field to determine graph id, then set graph property or singleValueExtendedProperty- Parameters:
alias- field aliasvalue- property value- Throws:
org.codehaus.jettison.json.JSONException- on error
-
put
public GraphObject put(String key, org.codehaus.jettison.json.JSONArray value) throws org.codehaus.jettison.json.JSONException - Throws:
org.codehaus.jettison.json.JSONException
-
put
public GraphObject put(String key, org.codehaus.jettison.json.JSONObject value) throws org.codehaus.jettison.json.JSONException - Throws:
org.codehaus.jettison.json.JSONException
-
setCategories
Set categories from comma separated values.- Parameters:
values- comma separated values- Throws:
org.codehaus.jettison.json.JSONException- on error
-
setCategories
- Throws:
org.codehaus.jettison.json.JSONException
-
getSingleValueExtendedProperties
protected org.codehaus.jettison.json.JSONArray getSingleValueExtendedProperties() throws org.codehaus.jettison.json.JSONExceptionGet a singleValueExtendedProperties JSON array. Create an empty JSON array on the first call.- Returns:
- singleValueExtendedProperties array
- Throws:
org.codehaus.jettison.json.JSONException- on error
-
putSingleValueExtendedProperty
protected void putSingleValueExtendedProperty(String key, Object value) throws org.codehaus.jettison.json.JSONException Set or replace a single value extended property. If a property with the same id already exists, replace its value; otherwise append a new entry.- Parameters:
key- property idvalue- property value- Throws:
org.codehaus.jettison.json.JSONException- on error
-
getString
Get mandatory property value.- Parameters:
key- property name- Returns:
- value
- Throws:
org.codehaus.jettison.json.JSONException- on missing property
-
optSectionString
Get optional parameter from JSON property.- Parameters:
section- JSON property namekey- internal property name- Returns:
- value or null
-
getBoolean
- Throws:
org.codehaus.jettison.json.JSONException
-
optBoolean
-
getBoolean
- Throws:
org.codehaus.jettison.json.JSONException
-
optBoolean
-
optJSONObject
-
optDateTimeTimeZone
Convert datetimetimezone to java date. Graph API returns some dates as json object with dateTime and timeZone, see datetimetimezone- Parameters:
key- property key, e.g. dueDateTime- Returns:
- java date
- Throws:
DavMailException- on error
-
getRecurrenceId
Compute recurrenceId property based on the original start and timezone.- Returns:
- recurrenceId property
- Throws:
DavMailException- on error
-
optInt
-
toString
- Throws:
org.codehaus.jettison.json.JSONException
-
setTaskStatusFromVTodo
- Throws:
org.codehaus.jettison.json.JSONException
-
getVTodoStatusFromTask
-
getTaskPriority
-
setTaskImportanceFromVTodo
public void setTaskImportanceFromVTodo(VObject vEvent) throws org.codehaus.jettison.json.JSONException - Throws:
org.codehaus.jettison.json.JSONException
-