public class TwitterFactory
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private Configuration |
conf |
(package private) static Authorization |
DEFAULT_AUTHORIZATION |
private static long |
serialVersionUID |
private static Twitter |
SINGLETON |
private static java.lang.reflect.Constructor<Twitter> |
TWITTER_CONSTRUCTOR |
Constructor and Description |
---|
TwitterFactory()
Creates a TwitterFactory with the root configuration.
|
TwitterFactory(Configuration conf)
Creates a TwitterFactory with the given configuration.
|
TwitterFactory(java.lang.String configTreePath)
Creates a TwitterFactory with a specified config tree
|
Modifier and Type | Method and Description |
---|---|
Twitter |
getInstance()
Returns a instance associated with the configuration bound to this factory.
|
Twitter |
getInstance(AccessToken accessToken)
Returns a OAuth Authenticated instance.
consumer key and consumer Secret must be provided by twitter4j.properties, or system properties. Unlike OAuthSupport.setOAuthAccessToken(twitter4j.auth.AccessToken) , this factory method potentially returns a cached instance. |
Twitter |
getInstance(Authorization auth) |
static Twitter |
getSingleton()
Returns default singleton Twitter instance.
|
private static final java.lang.reflect.Constructor<Twitter> TWITTER_CONSTRUCTOR
static final Authorization DEFAULT_AUTHORIZATION
private static final Twitter SINGLETON
private static final long serialVersionUID
private final Configuration conf
public TwitterFactory()
public TwitterFactory(Configuration conf)
conf
- the configuration to usepublic TwitterFactory(java.lang.String configTreePath)
configTreePath
- the pathpublic Twitter getInstance()
public Twitter getInstance(AccessToken accessToken)
OAuthSupport.setOAuthAccessToken(twitter4j.auth.AccessToken)
, this factory method potentially returns a cached instance.accessToken
- access tokenpublic Twitter getInstance(Authorization auth)
public static Twitter getSingleton()