public final class DataObjectFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.reflect.Constructor<AccountTotals> |
accountTotalsConstructor |
private static java.lang.reflect.Constructor<Category> |
categoryConstructor |
private static java.lang.reflect.Constructor<DirectMessage> |
directMessageConstructor |
private static java.lang.reflect.Constructor<IDs> |
IDsConstructor |
private static java.lang.reflect.Constructor<Location> |
locationConstructor |
private static java.lang.reflect.Constructor<Place> |
placeConstructor |
private static java.lang.reflect.Constructor<RateLimitStatus> |
rateLimitStatusConstructor |
private static java.lang.ThreadLocal<java.util.Map> |
rawJsonMap |
private static java.lang.reflect.Constructor<RelatedResults> |
relatedResultsConstructor |
private static java.lang.reflect.Constructor<Relationship> |
relationshipConstructor |
private static java.lang.reflect.Constructor<SavedSearch> |
savedSearchConstructor |
private static java.lang.reflect.Constructor<Status> |
statusConstructor |
private static java.lang.reflect.Constructor<StatusDeletionNotice> |
statusDeletionNoticeConstructor |
private static java.lang.reflect.Constructor<Trend> |
trendConstructor |
private static java.lang.reflect.Constructor<Trends> |
trendsConstructor |
private static java.lang.reflect.Constructor<Tweet> |
tweetConstructor |
private static java.lang.reflect.Constructor<User> |
userConstructor |
private static java.lang.reflect.Constructor<UserList> |
userListConstructor |
Modifier | Constructor and Description |
---|---|
private |
DataObjectFactory() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
clearThreadLocalMap()
clear raw JSON forms associated with the current thread.
Currently this method is called indirectly by twitter4j.internal.util.DataObjectFactoryUtil, and should be called directly once *JSONImpl classes are migrated to twitter4j.json.* package. |
static AccountTotals |
createAccountTotals(java.lang.String rawJSON)
Constructs an AccountTotals object from rawJSON string.
|
static Category |
createCategory(java.lang.String rawJSON)
Constructs a Category object from rawJSON string.
|
static DirectMessage |
createDirectMessage(java.lang.String rawJSON)
Constructs a DirectMessage object from rawJSON string.
|
static IDs |
createIDs(java.lang.String rawJSON)
Constructs a IDs object from rawJSON string.
|
static Location |
createLocation(java.lang.String rawJSON)
Constructs a Location object from rawJSON string.
|
static java.lang.Object |
createObject(java.lang.String rawJSON)
Construct an object from rawJSON string.
|
static Place |
createPlace(java.lang.String rawJSON)
Constructs a Place object from rawJSON string.
|
static RateLimitStatus |
createRateLimitStatus(java.lang.String rawJSON)
Constructs a RateLimitStatus object from rawJSON string.
|
static RelatedResults |
createRelatedResults(java.lang.String rawJSON)
Constructs a RelatedResults object from rawJSON string.
|
static Relationship |
createRelationship(java.lang.String rawJSON)
Constructs a Relationship object from rawJSON string.
|
static SavedSearch |
createSavedSearch(java.lang.String rawJSON)
Constructs a SavedSearch object from rawJSON string.
|
static Status |
createStatus(java.lang.String rawJSON)
Constructs a Status object from rawJSON string.
|
static Trend |
createTrend(java.lang.String rawJSON)
Constructs a Trend object from rawJSON string.
|
static Trends |
createTrends(java.lang.String rawJSON)
Constructs a Trends object from rawJSON string.
|
static Tweet |
createTweet(java.lang.String rawJSON)
Constructs a Tweet object from rawJSON string.
|
static User |
createUser(java.lang.String rawJSON)
Constructs a User object from rawJSON string.
|
static UserList |
createUserList(java.lang.String rawJSON)
Constructs a UserList object from rawJSON string.
|
static java.lang.String |
getRawJSON(java.lang.Object obj)
Returns a raw JSON form of the provided object.
Note that raw JSON forms can be retrieved only from the same thread invoked the last method call and will become inaccessible once another method call |
(package private) static <T> T |
registerJSONObject(T key,
java.lang.Object json)
associate a raw JSON form to the current thread
Currently this method is called indirectly by twitter4j.internal.util.DataObjectFactoryUtil, and should be called directly once *JSONImpl classes are migrated to twitter4j.json.* package. |
private static final java.lang.reflect.Constructor<Status> statusConstructor
private static final java.lang.reflect.Constructor<User> userConstructor
private static final java.lang.reflect.Constructor<Tweet> tweetConstructor
private static final java.lang.reflect.Constructor<Relationship> relationshipConstructor
private static final java.lang.reflect.Constructor<Place> placeConstructor
private static final java.lang.reflect.Constructor<SavedSearch> savedSearchConstructor
private static final java.lang.reflect.Constructor<Trend> trendConstructor
private static final java.lang.reflect.Constructor<Trends> trendsConstructor
private static final java.lang.reflect.Constructor<IDs> IDsConstructor
private static final java.lang.reflect.Constructor<RateLimitStatus> rateLimitStatusConstructor
private static final java.lang.reflect.Constructor<Category> categoryConstructor
private static final java.lang.reflect.Constructor<DirectMessage> directMessageConstructor
private static final java.lang.reflect.Constructor<Location> locationConstructor
private static final java.lang.reflect.Constructor<UserList> userListConstructor
private static final java.lang.reflect.Constructor<RelatedResults> relatedResultsConstructor
private static final java.lang.reflect.Constructor<StatusDeletionNotice> statusDeletionNoticeConstructor
private static final java.lang.reflect.Constructor<AccountTotals> accountTotalsConstructor
private static java.lang.ThreadLocal<java.util.Map> rawJsonMap
public static java.lang.String getRawJSON(java.lang.Object obj)
obj
- public static Status createStatus(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static User createUser(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static AccountTotals createAccountTotals(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static Tweet createTweet(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static Relationship createRelationship(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static Place createPlace(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static SavedSearch createSavedSearch(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static Trend createTrend(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static Trends createTrends(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static IDs createIDs(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static RateLimitStatus createRateLimitStatus(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static Category createCategory(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static DirectMessage createDirectMessage(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static Location createLocation(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static UserList createUserList(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static RelatedResults createRelatedResults(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.public static java.lang.Object createObject(java.lang.String rawJSON) throws TwitterException
rawJSON
- raw JSON form as StringTwitterException
- when provided string is not a valid JSON string.static void clearThreadLocalMap()
static <T> T registerJSONObject(T key, java.lang.Object json)