signature:
public class FacebookUtils { /** * Retrieves the current permissions for token provided .
 * @ param parent The current context .
 * @ param token The token for which we are going to retrieve permissions .
 * @ param callback A callback to handle the response . */
public static void getCurrentPermissions ( Activity context , String token , OnPermissionResult callback ) { } }

implementation: proxy . getCurrentPermissions ( context , token , callback ) ;


signature:
public class FacebookUtils { /** * Returns the hash key used to authenticate this application with Facebook . Useful for debugging .
 * @ param context
 * @ return
 * @ throws NoSuchAlgorithmException */
public static String [ ] getHashKeys ( Activity context ) throws NoSuchAlgorithmException { } }

implementation: PackageInfo packageInfo = null ; String [ ] keys = null ; try { packageInfo = context . getPackageManager ( ) . getPackageInfo ( context . getPackageName ( ) , PackageManager . GET_SIGNATURES ) ; if ( packageInfo != null && packageInfo . signatures != null && packageInfo . signatures . length > 0 ) { keys = new String [ packageInfo . signatures . length ] ; for ( int i = 0 ; i < packageInfo . signatures . length ; i ++ ) { Signature signature = packageInfo . signatures [ i ] ; MessageDigest md = MessageDigest . getInstance ( "SHA1" ) ; md . update ( signature . toByteArray ( ) ) ; String hash = new String ( Base64 . encode ( md . digest ( ) , 0 ) ) ; keys [ i ] = hash ; } } } catch ( PackageManager . NameNotFoundException e ) { e . printStackTrace ( ) ; } return keys ;


signature:
public class SmsShareHandler { /** * / * ( non - Javadoc )
 * @ see com . socialize . share . AbstractShareHandler # handle ( android . app . Activity , com . socialize . entity . SocializeAction , java . lang . String , com . socialize . entity . PropagationInfo , com . socialize . share . ShareHandlerListener ) */
@ Override protected void handle ( Activity context , SocializeAction action , String text , PropagationInfo info , SocialNetworkListener listener ) throws Exception { } }

implementation: boolean shareCancelled = false ; Entity entity = action . getEntity ( ) ; HashMap < String , Object > postValues = new HashMap < String , Object > ( ) ; postValues . put ( ShareUtils . EXTRA_TEXT , shareMessageBuilder . buildShareMessage ( action . getEntity ( ) , info , text , false , true ) ) ; DefaultPostData postData = new DefaultPostData ( ) ; postData . setEntity ( entity ) ; postData . setPropagationInfo ( info ) ; postData . setPostValues ( postValues ) ; if ( listener != null ) { shareCancelled = listener . onBeforePost ( context , null , postData ) ; } if ( ! shareCancelled ) { String body = String . valueOf ( postValues . get ( ShareUtils . EXTRA_TEXT ) ) ; Intent sendIntent = getIntent ( context ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . KITKAT ) { sendIntent . putExtra ( Intent . EXTRA_TEXT , body ) ; } else { sendIntent . putExtra ( "sms_body" , body ) ; } context . startActivity ( sendIntent ) ; } if ( listener != null ) { listener . onAfterPost ( context , null , null ) ; }


signature:
public class EntityUtils { /** * Saves or Creates an entity
 * @ param context The current context .
 * @ param e The entity to be created .
 * @ param listener A listener to handle the result . */
public static void saveEntity ( Activity context , Entity e , EntityAddListener listener ) { } }

implementation: proxy . saveEntity ( context , e , listener ) ;


signature:
public class EntityUtils { /** * Retrieves an entity based on its key .
 * @ param context The current context .
 * @ param key The entity key .
 * @ param listener A listener to handle the result . */
public static void getEntity ( Activity context , String key , EntityGetListener listener ) { } }

implementation: proxy . getEntity ( context , key , listener ) ;


signature:
public class EntityUtils { /** * Retrieves an entity based on its id .
 * @ param context The current context .
 * @ param id The entity id .
 * @ param listener A listener to handle the result . */
public static void getEntity ( Activity context , long id , EntityGetListener listener ) { } }

implementation: proxy . getEntity ( context , id , listener ) ;


signature:
public class EntityUtils { /** * Retrieves all entities sorted by creation date .
 * @ param context The current context .
 * @ param start The start index for pagination ( 0 based ) .
 * @ param end The end index for pagination ( 0 based ) .
 * @ param listener A listener to handle the result . */
public static void getEntities ( Activity context , int start , int end , EntityListListener listener ) { } }

implementation: proxy . getEntities ( context , start , end , SortOrder . CREATION_DATE , listener ) ;


signature:
public class EntityUtils { /** * Retrieves the entities designated by the given keys .
 * @ param context The current context .
 * @ param listener A listener to handle the result .
 * @ param keys One or more entity keys . */
public static void getEntities ( Activity context , EntityListListener listener , String ... keys ) { } }

implementation: proxy . getEntities ( context , SortOrder . CREATION_DATE , listener , keys ) ;


signature:
public class EntityUtils { /** * Uses the registered entity loader ( if one exists ) to load the entity denoted by the given entity key .
 * @ param context The current context .
 * @ param key The entity key .
 * @ param listener A listener to handle the result . */
public static void showEntity ( Activity context , String key , EntityGetListener listener ) { } }

implementation: proxy . showEntity ( context , key , listener ) ;


signature:
public class EntityUtils { /** * Uses the registered entity loader ( if one exists ) to load the entity denoted by the given entity ID .
 * @ param context The current context .
 * @ param id The entity id .
 * @ param listener A listener to handle the result . */
public static void showEntity ( Activity context , long id , EntityGetListener listener ) { } }

implementation: proxy . showEntity ( context , id , listener ) ;


signature:
public class DefaultSocializeActivityLifecycleListener { /** * Called BEFORE the default activity onCreateContextMenu event .
 * @ param activity The calling activity .
 * @ param menu The context menu that is being built
 * @ param v The view for which the context menu is being built
 * @ param menuInfo Extra information about the item for which the context menu should be shown . This information will vary depending on the class of v .
 * @ return True to PREVENT the default implementation from executing . */
@ Override public boolean onCreateContextMenu ( SocializeUIActivity activity , ContextMenu menu , View v , ContextMenu . ContextMenuInfo menuInfo ) { } }

implementation: return false ;


signature:
public class BaseDialogFactory { /** * So we can mock */
protected Dialog newDialog ( Context context ) { } }

implementation:
Dialog dialog = new Dialog ( context , android . R . style . Theme_Dialog ) ; dialog . requestWindowFeature ( Window . FEATURE_NO_TITLE ) ; // Register to prevent window leakage
DialogRegistration . register ( context , dialog ) ; return dialog ;


signature:
public class SubscriptionUtils { /** * Subscribes the current user to notifications for new comments on this entity .
 * @ param context The current context .
 * @ param e The entity .
 * @ param type The subscription type .
 * @ param listener A listener to handle the result . */
public static void subscribe ( Activity context , Entity e , SubscriptionType type , SubscriptionResultListener listener ) { } }

implementation: subscriptionUtils . subscribe ( context , e , type , listener ) ;


signature:
public class SubscriptionUtils { /** * Determines if the current user is subscribed to notifications on new comments for the given entity .
 * @ param context The current context .
 * @ param e The entity .
 * @ param type The subscription type .
 * @ param listener A listener to handle the result . */
public static void isSubscribed ( Activity context , Entity e , SubscriptionType type , SubscriptionCheckListener listener ) { } }

implementation: subscriptionUtils . isSubscribed ( context , e , type , listener ) ;


signature:
public class DirectEntityMessageTranslator { /** * ( non - Javadoc )
 * @ see com . socialize . notifications . MessageTranslator # translateTo ( android . content . Context , android . os . Bundle , com . socialize . notifications . NotificationMessage ) */
@ Override public SimpleNotificationMessage translate ( Context context , Bundle data , NotificationMessage message ) throws SocializeException { } }

implementation: SimpleNotificationMessage notify = new SimpleNotificationMessage ( ) ; if ( message . getEntityId ( ) != null ) { notify . setTitle ( message . getText ( ) ) ; notify . setText ( message . getText ( ) ) ; data . putLong ( Socialize . ENTITY_ID , message . getEntityId ( ) ) ; } else { throw new SocializeException ( "No entity id found in notification of type [" + message . getNotificationType ( ) + "]" ) ; } return notify ;


signature:
public class V3LoginActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . SDKDemoActivity # executeDemo ( java . lang . String ) */
@ Override public void executeDemo ( final String text ) { } }

implementation:
// start Facebook Login
Session . OpenRequest auth = new Session . OpenRequest ( this ) ; String [ ] permissions = { "publish_actions" , "user_status" } ; auth . setPermissions ( Arrays . asList ( permissions ) ) ; auth . setLoginBehavior ( SessionLoginBehavior . SSO_WITH_FALLBACK ) ; auth . setCallback ( new Session . StatusCallback ( ) { // callback when session changes state
@ Override public void call ( Session session , SessionState state , Exception exception ) { switch ( state ) { case OPENING : System . out . println ( "OPENING" ) ; break ; case OPENED : System . out . println ( "OPENED" ) ; if ( session . isOpened ( ) ) { // make request to the / me API
Request . executeMeRequestAsync ( session , new Request . GraphUserCallback ( ) { // callback after Graph API response with user object
@ Override public void onCompleted ( GraphUser user , Response response ) { if ( response . getError ( ) != null ) { handleError ( V3LoginActivity . this , response . getError ( ) . getException ( ) ) ; } else if ( user != null ) { handleResult ( "Success! " + user . getUsername ( ) ) ; } } } ) ; } break ; case CREATED : System . out . println ( "CREATED" ) ; break ; case CREATED_TOKEN_LOADED : System . out . println ( "CREATED_TOKEN_LOADED" ) ; break ; case OPENED_TOKEN_UPDATED : System . out . println ( "OPENED_TOKEN_UPDATED" ) ; break ; case CLOSED : System . out . println ( "CLOSED" ) ; if ( exception != null ) { handleError ( V3LoginActivity . this , exception ) ; } else { handleCancel ( ) ; } break ; case CLOSED_LOGIN_FAILED : System . out . println ( "CLOSED_LOGIN_FAILED" ) ; if ( exception != null ) { handleError ( V3LoginActivity . this , exception ) ; } else { handleCancel ( ) ; } break ; } } } ) ; Session session = new Session . Builder ( this ) . setApplicationId ( "268891373224435" ) . build ( ) ; Session . setActiveSession ( session ) ; session . openForPublish ( auth ) ;


signature:
public class GetSharesByEntityActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: ShareUtils . getSharesByEntity ( this , entity . getKey ( ) , 0 , PAGE_SIZE , new ShareListListener ( ) { @ Override public void onList ( ListResult < Share > shares ) { handleSocializeResult ( shares ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetSharesByEntityActivity . this , error ) ; } } ) ;


signature:
public class AsyncLauncher { /** * / * ( non - Javadoc )
 * @ see android . os . AsyncTask # doInBackground ( Params [ ] ) */
@ Override protected Boolean doInBackground ( Void ... params ) { } }

implementation: try { return launcher . launch ( context , extras ) ; } catch ( Exception e ) { error = e ; } return false ;


signature:
public class DefaultInitializationAsserter { /** * / * ( non - Javadoc )
 * @ see com . socialize . init . SocializeInitializationAsserter # assertAuthenticated ( com . socialize . api . SocializeSession , com . socialize . listener . SocializeListener ) */
@ Override public boolean assertAuthenticated ( SocializeService service , SocializeSession session , SocializeListener listener ) { } }

implementation: if ( session != null ) { return true ; } else { if ( listener != null ) { if ( logger != null ) { listener . onError ( new SocializeException ( logger . getMessage ( SocializeLogger . NOT_AUTHENTICATED ) ) ) ; } else { listener . onError ( new SocializeException ( "Not authenticated" ) ) ; } } if ( logger != null ) logger . error ( SocializeLogger . NOT_AUTHENTICATED ) ; } return false ;


signature:
public class ListFriendsActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation:
// We need additional permissions for this
String [ ] permissions = { "user_friends" } ; FacebookUtils . linkForRead ( this , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( ListFriendsActivity . this , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAuthSuccess ( SocializeSession session ) { FacebookUtils . get ( ListFriendsActivity . this , "me/friends" , null , new SocialNetworkPostListener ( ) { @ Override public void onNetworkError ( Activity context , SocialNetwork network , Exception error ) { handleError ( context , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAfterPost ( Activity parent , SocialNetwork socialNetwork , JSONObject responseObject ) { try { JSONArray jsonArray = responseObject . getJSONArray ( "data" ) ; StringBuilder builder = new StringBuilder ( ) ; int len = jsonArray . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { JSONObject jsonObject = jsonArray . getJSONObject ( i ) ; if ( jsonObject . has ( "name" ) ) { if ( i > 0 ) { builder . append ( "\n" ) ; } builder . append ( jsonObject . get ( "name" ) ) ; } } handleResult ( builder . toString ( ) ) ; } catch ( JSONException e ) { handleError ( parent , e ) ; } } } ) ; } @ Override public void onAuthFail ( SocializeException error ) { handleError ( ListFriendsActivity . this , error ) ; } } , permissions ) ;


signature:
public class SocializeEntitySystem { /** * ( non - Javadoc )
 * @ see com . socialize . api . action . EntitySystem # addEntity ( com . socialize . api . SocializeSession , com . socialize . entity . Entity , com . socialize . listener . entity . EntityListener ) */
@ Override public void addEntity ( SocializeSession session , Entity entity , EntityListener listener ) { } }

implementation: List < Entity > list = new ArrayList < Entity > ( 1 ) ; list . add ( entity ) ; postAsync ( session , ENDPOINT , list , listener ) ;


signature:
public class SocializeEntitySystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . EnitySystem # getEntity ( com . socialize . api . SocializeSession , java . lang . String , com . socialize . listener . entity . EntityListener ) */
@ Override public void getEntity ( SocializeSession session , final String key , final EntityListener listener ) { } }

implementation: listAsync ( session , ENDPOINT , key , null , null , 0 , 1 , getListenerForGet ( listener , "No entity found with key [" + key + "]" ) ) ;


signature:
public class SocializeEntitySystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . EnitySystem # listEntities ( com . socialize . api . SocializeSession , com . socialize . listener . entity . EntityListener , java . lang . String ) */
@ Override public void getEntities ( SocializeSession session , SortOrder sortOrder , EntityListener listener , String ... keys ) { } }

implementation: Map < String , String > extraParams = null ; if ( ! sortOrder . equals ( SortOrder . CREATION_DATE ) ) { extraParams = new HashMap < String , String > ( ) ; extraParams . put ( "sort" , sortOrder . name ( ) . toLowerCase ( ) ) ; } listAsync ( session , ENDPOINT , null , "entity_key" , extraParams , 0 , SocializeConfig . MAX_LIST_RESULTS , listener , keys ) ;


signature:
public class NotificationChecker { /** * Called at application startup .
 * @ param context */
public boolean checkRegistrations ( Context context , SocializeSession session ) { } }

implementation:
boolean checked = false ; if ( ! checking ) { checking = true ; try { if ( appUtils . isNotificationsAvailable ( context ) ) { if ( config . getBooleanProperty ( SocializeConfig . SOCIALIZE_CHECK_NOTIFICATIONS , true ) ) { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Checking GCM registration state" ) ; } boolean c2DMRegistered = notificationRegistrationSystem . isRegisteredC2DM ( context ) ; boolean socRegistered = notificationRegistrationSystem . isRegisteredSocialize ( context , session . getUser ( ) ) ; if ( ! c2DMRegistered || ! socRegistered ) { // Reload
notificationRegistrationState . reload ( context ) ; c2DMRegistered = notificationRegistrationSystem . isRegisteredC2DM ( context ) ; socRegistered = notificationRegistrationSystem . isRegisteredSocialize ( context , session . getUser ( ) ) ; if ( ! c2DMRegistered || ! socRegistered ) { if ( ! c2DMRegistered && config . getBooleanProperty ( SocializeConfig . GCM_REGISTRATION_ENABLED , true ) ) { if ( notificationRegistrationSystem . isRegistrationPending ( ) ) { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "GCM Registration already pending" ) ; } } else { if ( logger != null && logger . isInfoEnabled ( ) ) { logger . info ( "Not registered with GCM, sending registration request..." ) ; } notificationRegistrationSystem . registerC2DMAsync ( context ) ; } } else if ( ! socRegistered && ! StringUtils . isEmpty ( notificationRegistrationState . getC2DMRegistrationId ( ) ) ) { if ( notificationRegistrationSystem . isSocializeRegistrationPending ( ) ) { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "Registration already pending with Socialize for GCM" ) ; } } else { if ( logger != null && logger . isInfoEnabled ( ) ) { logger . info ( "Not registered with Socialize for GCM, registering..." ) ; } notificationRegistrationSystem . registerSocialize ( context , notificationRegistrationState . getC2DMRegistrationId ( ) ) ; } } } else { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "GCM registration OK" ) ; } } } else { if ( logger != null && logger . isDebugEnabled ( ) ) { logger . debug ( "GCM registration OK" ) ; } } checked = true ; } else { if ( logger != null && logger . isWarnEnabled ( ) ) { logger . warn ( "GCM registration check skipped" ) ; } } } else { if ( logger != null && logger . isInfoEnabled ( ) ) { logger . info ( "Notifications not enabled.  Check the AndroidManifest.xml for correct configuration." ) ; } checked = true ; } } finally { checking = false ; } } return checked ;


signature:
public class SocializeBroadcastReceiver { /** * / * ( non - Javadoc )
 * @ see android . content . BroadcastReceiver # onReceive ( android . content . Context , android . content . Intent ) */
@ Override public void onReceive ( Context context , Intent intent ) { } }

implementation: getSocialize ( ) . handleBroadcastIntent ( context , intent ) ;


signature:
public class UserActivityActionText { /** * / * ( non - Javadoc )
 * @ see com . socialize . ui . profile . activity . UserActivityAction # setAction ( com . socialize . entity . SocializeAction ) */
@ Override public void setAction ( Context context , final SocializeAction action ) { } }

implementation: try { doSetAction ( action ) ; } catch ( Exception e ) { setText ( "Error!" ) ; if ( logger != null ) { logger . error ( "Error rendering action text" , e ) ; } else { SocializeLogger . e ( e . getMessage ( ) , e ) ; } }


signature:
public class GetTokenActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: TwitterUtils . link ( this , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( GetTokenActivity . this , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAuthSuccess ( SocializeSession session ) { UserProviderCredentials userProviderCredentials = session . getUserProviderCredentials ( AuthProviderType . TWITTER ) ; handleResult ( userProviderCredentials . getAccessToken ( ) ) ; } @ Override public void onAuthFail ( SocializeException error ) { handleError ( GetTokenActivity . this , error ) ; } } ) ;


signature:
public class JsonReader { /** * Returns the type of the next token without consuming it . */
public JsonToken peek ( ) throws IOException { } }

implementation: if ( token != null ) { return token ; } switch ( stack [ stackSize - 1 ] ) { case EMPTY_DOCUMENT : if ( lenient ) { consumeNonExecutePrefix ( ) ; } stack [ stackSize - 1 ] = JsonScope . NONEMPTY_DOCUMENT ; JsonToken firstToken = nextValue ( ) ; if ( ! lenient && token != JsonToken . BEGIN_ARRAY && token != JsonToken . BEGIN_OBJECT ) { throw new IOException ( "Expected JSON document to start with '[' or '{' but was " + token + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } return firstToken ; case EMPTY_ARRAY : return nextInArray ( true ) ; case NONEMPTY_ARRAY : return nextInArray ( false ) ; case EMPTY_OBJECT : return nextInObject ( true ) ; case DANGLING_NAME : return objectValue ( ) ; case NONEMPTY_OBJECT : return nextInObject ( false ) ; case NONEMPTY_DOCUMENT : int c = nextNonWhitespace ( false ) ; if ( c == - 1 ) { return JsonToken . END_DOCUMENT ; } pos -- ; if ( ! lenient ) { throw syntaxError ( "Expected EOF" ) ; } return nextValue ( ) ; case CLOSED : throw new IllegalStateException ( "JsonReader is closed" ) ; default : throw new AssertionError ( ) ; }


signature:
public class JsonReader { /** * Returns the { @ link JsonToken # STRING string } value of the next token ,
 * consuming it . If the next token is a number , this method will return its
 * string form .
 * @ throws IllegalStateException if the next token is not a string or if
 * this reader is closed . */
public String nextString ( ) throws IOException { } }

implementation: peek ( ) ; if ( token != JsonToken . STRING && token != JsonToken . NUMBER ) { throw new IllegalStateException ( "Expected a string but was " + peek ( ) + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } String result = value ; advance ( ) ; return result ;


signature:
public class JsonReader { /** * Returns the { @ link JsonToken # BOOLEAN boolean } value of the next token ,
 * consuming it .
 * @ throws IllegalStateException if the next token is not a boolean or if
 * this reader is closed . */
public boolean nextBoolean ( ) throws IOException { } }

implementation: peek ( ) ; if ( token != JsonToken . BOOLEAN ) { throw new IllegalStateException ( "Expected a boolean but was " + token + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } boolean result = ( value == TRUE ) ; advance ( ) ; return result ;


signature:
public class JsonReader { /** * Consumes the next token from the JSON stream and asserts that it is a
 * literal null .
 * @ throws IllegalStateException if the next token is not null or if this
 * reader is closed . */
public void nextNull ( ) throws IOException { } }

implementation: peek ( ) ; if ( token != JsonToken . NULL ) { throw new IllegalStateException ( "Expected null but was " + token + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } advance ( ) ;


signature:
public class JsonReader { /** * Returns the { @ link JsonToken # NUMBER double } value of the next token ,
 * consuming it . If the next token is a string , this method will attempt to
 * parse it as a double using { @ link Double # parseDouble ( String ) } .
 * @ throws IllegalStateException if the next token is not a literal value .
 * @ throws NumberFormatException if the next literal value cannot be parsed
 * as a double , or is non - finite . */
public double nextDouble ( ) throws IOException { } }

implementation: peek ( ) ; if ( token != JsonToken . STRING && token != JsonToken . NUMBER ) { throw new IllegalStateException ( "Expected a double but was " + token + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } double result = Double . parseDouble ( value ) ; if ( ( result >= 1.0d && value . startsWith ( "0" ) ) ) { throw new MalformedJsonException ( "JSON forbids octal prefixes: " + value + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } if ( ! lenient && ( Double . isNaN ( result ) || Double . isInfinite ( result ) ) ) { throw new MalformedJsonException ( "JSON forbids NaN and infinities: " + value + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } advance ( ) ; return result ;


signature:
public class JsonReader { /** * Returns the { @ link JsonToken # NUMBER long } value of the next token ,
 * consuming it . If the next token is a string , this method will attempt to
 * parse it as a long . If the next token ' s numeric value cannot be exactly
 * represented by a Java { @ code long } , this method throws .
 * @ throws IllegalStateException if the next token is not a literal value .
 * @ throws NumberFormatException if the next literal value cannot be parsed
 * as a number , or exactly represented as a long . */
public long nextLong ( ) throws IOException { } }

implementation:
peek ( ) ; if ( token != JsonToken . STRING && token != JsonToken . NUMBER ) { throw new IllegalStateException ( "Expected a long but was " + token + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } long result ; try { result = Long . parseLong ( value ) ; } catch ( NumberFormatException ignored ) { double asDouble = Double . parseDouble ( value ) ; // don ' t catch this NumberFormatException
result = ( long ) asDouble ; if ( result != asDouble ) { throw new NumberFormatException ( "Expected a long but was " + value + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } } if ( result >= 1L && value . startsWith ( "0" ) ) { throw new MalformedJsonException ( "JSON forbids octal prefixes: " + value + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } advance ( ) ; return result ;


signature:
public class JsonReader { /** * Returns the { @ link JsonToken # NUMBER int } value of the next token ,
 * consuming it . If the next token is a string , this method will attempt to
 * parse it as an int . If the next token ' s numeric value cannot be exactly
 * represented by a Java { @ code int } , this method throws .
 * @ throws IllegalStateException if the next token is not a literal value .
 * @ throws NumberFormatException if the next literal value cannot be parsed
 * as a number , or exactly represented as an int . */
public int nextInt ( ) throws IOException { } }

implementation:
peek ( ) ; if ( token != JsonToken . STRING && token != JsonToken . NUMBER ) { throw new IllegalStateException ( "Expected an int but was " + token + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } int result ; try { result = Integer . parseInt ( value ) ; } catch ( NumberFormatException ignored ) { double asDouble = Double . parseDouble ( value ) ; // don ' t catch this NumberFormatException
result = ( int ) asDouble ; if ( result != asDouble ) { throw new NumberFormatException ( "Expected an int but was " + value + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } } if ( result >= 1L && value . startsWith ( "0" ) ) { throw new MalformedJsonException ( "JSON forbids octal prefixes: " + value + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } advance ( ) ; return result ;


signature:
public class JsonReader { /** * Closes this JSON reader and the underlying { @ link Reader } . */
public void close ( ) throws IOException { } }

implementation: value = null ; token = null ; stack [ 0 ] = JsonScope . CLOSED ; stackSize = 1 ; in . close ( ) ;


signature:
public class JsonReader { /** * Returns true once { @ code limit - pos > = minimum } . If the data is
 * exhausted before that many characters are available , this returns
 * false . */
private boolean fillBuffer ( int minimum ) throws IOException { } }

implementation:
char [ ] buffer = this . buffer ; // Before clobbering the old characters , update where buffer starts
// Using locals here saves ~ 2 % .
int line = bufferStartLine ; int column = bufferStartColumn ; for ( int i = 0 , p = pos ; i < p ; i ++ ) { if ( buffer [ i ] == '\n' ) { line ++ ; column = 1 ; } else { column ++ ; } } bufferStartLine = line ; bufferStartColumn = column ; if ( limit != pos ) { limit -= pos ; System . arraycopy ( buffer , pos , buffer , 0 , limit ) ; } else { limit = 0 ; } pos = 0 ; int total ; while ( ( total = in . read ( buffer , limit , buffer . length - limit ) ) != - 1 ) { limit += total ; // if this is the first read , consume an optional byte order mark ( BOM ) if it exists
if ( bufferStartLine == 1 && bufferStartColumn == 1 && limit > 0 && buffer [ 0 ] == '\ufeff' ) { pos ++ ; bufferStartColumn -- ; } if ( limit >= minimum ) { return true ; } } return false ;


signature:
public class JsonReader { /** * Unescapes the character identified by the character or characters that
 * immediately follow a backslash . The backslash ' \ ' should have already
 * been read . This supports both unicode escapes " u000A " and two - character
 * escapes " \ n " .
 * @ throws NumberFormatException if any unicode escape sequences are
 * malformed . */
private char readEscapeCharacter ( ) throws IOException { } }

implementation:
if ( pos == limit && ! fillBuffer ( 1 ) ) { throw syntaxError ( "Unterminated escape sequence" ) ; } char escaped = buffer [ pos ++ ] ; switch ( escaped ) { case 'u' : if ( pos + 4 > limit && ! fillBuffer ( 4 ) ) { throw syntaxError ( "Unterminated escape sequence" ) ; } // Equivalent to Integer . parseInt ( stringPool . get ( buffer , pos , 4 ) , 16 ) ;
char result = 0 ; for ( int i = pos , end = i + 4 ; i < end ; i ++ ) { char c = buffer [ i ] ; result <<= 4 ; if ( c >= '0' && c <= '9' ) { result += ( c - '0' ) ; } else if ( c >= 'a' && c <= 'f' ) { result += ( c - 'a' + 10 ) ; } else if ( c >= 'A' && c <= 'F' ) { result += ( c - 'A' + 10 ) ; } else { throw new NumberFormatException ( "\\u" + stringPool . get ( buffer , pos , 4 ) ) ; } } pos += 4 ; return result ; case 't' : return '\t' ; case 'b' : return '\b' ; case 'n' : return '\n' ; case 'r' : return '\r' ; case 'f' : return '\f' ; case '\'' : case '"' : case '\\' : default : return escaped ; }


signature:
public class ShareUtils { /** * Displays the default share dialog . In most cases this is the simplest version to use .
 * @ param context The current context .
 * @ param entity The entity being shared . */
public static void showShareDialog ( Activity context , Entity entity ) { } }

implementation: proxy . showShareDialog ( context , entity , DEFAULT , null , null ) ;


signature:
public class ShareUtils { /** * Displays the default share dialog and allows for the handling of share dialog events .
 * @ param context The current context .
 * @ param entity The entity being shared .
 * @ param listener A listener to handle events on the dialog . */
public static void showShareDialog ( Activity context , Entity entity , SocialNetworkDialogListener listener ) { } }

implementation: proxy . showShareDialog ( context , entity , DEFAULT , listener , listener ) ;


signature:
public class ShareUtils { /** * Shares the given entity via email . This method with launch the default email application on the device .
 * @ param context The current context .
 * @ param entity The entity being shared .
 * @ param listener A listener to handle events . */
public static void shareViaEmail ( Activity context , Entity entity , ShareAddListener listener ) { } }

implementation: proxy . shareViaEmail ( context , entity , listener ) ;


signature:
public class ShareUtils { /** * Shares the given entity via Google + . This method with launch the Google + application on the device .
 * @ param context The current context .
 * @ param entity The entity being shared .
 * @ param listener A listener to handle events . */
public static void shareViaGooglePlus ( Activity context , Entity entity , ShareAddListener listener ) { } }

implementation: proxy . shareViaGooglePlus ( context , entity , listener ) ;


signature:
public class ShareUtils { /** * Shares the given entity via a user selected medium . This method with launch the default application share dialog on the device .
 * @ param context The current context .
 * @ param entity The entity being shared .
 * @ param listener A listener to handle events . */
public static void shareViaOther ( Activity context , Entity entity , ShareAddListener listener ) { } }

implementation: proxy . shareViaOther ( context , entity , listener ) ;


signature:
public class ShareUtils { /** * Shares the given entity via SMS . This method with launch the default SMS application on the device .
 * @ param context The current context .
 * @ param entity The entity being shared .
 * @ param listener A listener to handle events . */
public static void shareViaSMS ( Activity context , Entity entity , ShareAddListener listener ) { } }

implementation: proxy . shareViaSMS ( context , entity , listener ) ;


signature:
public class ShareUtils { /** * Shares the given entity via a Social Network such as Twitter or Facebook . This will prompt the user to select a network .
 * @ param context The current context .
 * @ param entity The entity being shared .
 * @ param shareOptions Options for the share . If text is available for the share it can be specified here .
 * @ param listener A listener to handle events . */
public static void shareViaSocialNetworks ( Activity context , Entity entity , ShareOptions shareOptions , SocialNetworkShareListener listener , SocialNetwork ... networks ) { } }

implementation: proxy . shareViaSocialNetworks ( context , entity , shareOptions , listener , networks ) ;


signature:
public class ShareUtils { /** * Retrieves a single share event based on ID .
 * @ param context The current context .
 * @ param listener A listener to handle the result .
 * @ param id The ID of the share . */
public static void getShare ( Activity context , ShareGetListener listener , long id ) { } }

implementation: proxy . getShare ( context , listener , id ) ;


signature:
public class ShareUtils { /** * Retrieves multiple share events based on ID .
 * @ param context The current context .
 * @ param listener A listener to handle the result .
 * @ param ids One or more IDs for the shares returned . */
public static void getShares ( Activity context , ShareListListener listener , long ... ids ) { } }

implementation: proxy . getShares ( context , listener , ids ) ;


signature:
public class ShareUtils { /** * Retrieves all share events performed by the given user .
 * @ param context The current context .
 * @ param user The user who performed the share ( s ) .
 * @ param start The start index for the result set ( 0 indexed ) .
 * @ param end The end index for the result set .
 * @ param listener A listener to handle the result . */
public static void getSharesByUser ( Activity context , User user , int start , int end , ShareListListener listener ) { } }

implementation: proxy . getSharesByUser ( context , user , start , end , listener ) ;


signature:
public class ShareUtils { /** * Retrieves all share events performed on the given entity .
 * @ param context The current context .
 * @ param entityKey The key of the entity that was shared .
 * @ param start The start index for the result set ( 0 indexed ) .
 * @ param end The end index for the result set .
 * @ param listener A listener to handle the result . */
public static void getSharesByEntity ( Activity context , String entityKey , int start , int end , ShareListListener listener ) { } }

implementation: proxy . getSharesByEntity ( context , entityKey , start , end , listener ) ;


signature:
public class ShareUtils { /** * Retrieves all share events across all entities .
 * @ param context The current context .
 * @ param start The start index for the result set ( 0 indexed ) .
 * @ param end The end index for the result set .
 * @ param listener A listener to handle the result . */
public static void getSharesByApplication ( Activity context , int start , int end , ShareListListener listener ) { } }

implementation: proxy . getSharesByApplication ( context , start , end , listener ) ;


signature:
public class ShareUtils { /** * Creates a simple Socialize Share object .
 * NOTE : This does NOT perform any actual sharing ( propagation ) . It is used to simply record the fact that a share is taking place .
 * This is useful when you want to utilize the auto - generated entity links returned in the propagation info response to post directly
 * to Facebook or Twitter .
 * @ param context The current context .
 * @ param entity The entity to be shared .
 * @ param shareOptions Options for the share allowing text to be specified .
 * @ param listener A listener to handle the result .
 * @ param networks The Social Networks you intend to share to . */
public static void registerShare ( Activity context , Entity entity , ShareOptions shareOptions , ShareAddListener listener , SocialNetwork ... networks ) { } }

implementation: proxy . registerShare ( context , entity , shareOptions , listener , networks ) ;


signature:
public class GetEntityByKeyActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( final String text ) { } }

implementation: EntityUtils . getEntity ( this , text , new EntityGetListener ( ) { @ Override public void onGet ( Entity entity ) { handleBasicSocializeResult ( entity ) ; } @ Override public void onError ( SocializeException error ) { if ( isNotFoundError ( error ) ) { handleResult ( "No entity found with key [" + text + "]" ) ; } else { handleError ( GetEntityByKeyActivity . this , error ) ; } } } ) ;


signature:
public class DefaultProfileImageContextMenu { /** * / * ( non - Javadoc )
 * @ see com . socialize . ui . profile . ProfileImageContextMenu # show ( ) */
@ Override public void show ( ) { } }

implementation: if ( deviceUtils != null && deviceUtils . hasCamera ( ) ) { final String items [ ] = { "From Gallery" , "From Camera" } ; AlertDialog . Builder ab = new AlertDialog . Builder ( context ) ; ab . setTitle ( "New Profile Picture" ) ; ab . setItems ( items , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface d , int choice ) { if ( choice == 0 ) { launchGallery ( ) ; } else if ( choice == 1 ) { launchCamera ( ) ; } } } ) ; ab . setNegativeButton ( "Cancel" , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { dialog . cancel ( ) ; } } ) ; ab . show ( ) ; } else { launchGallery ( ) ; }


signature:
public class BaseFacebookFacade { /** * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # authenticate ( android . app . Activity , com . socialize . auth . facebook . FacebookAuthProviderInfo , com . socialize . listener . AuthProviderListener ) */
@ Override public void authenticateWithActivity ( Activity context , FacebookAuthProviderInfo info , boolean sso , final AuthProviderListener listener ) { } }

implementation: final String listenerKey = "auth" ; holder . push ( listenerKey , new AuthProviderListener ( ) { @ Override public void onError ( SocializeException error ) { holder . remove ( listenerKey ) ; listener . onError ( error ) ; } @ Override public void onAuthSuccess ( AuthProviderResponse response ) { holder . remove ( listenerKey ) ; listener . onAuthSuccess ( response ) ; } @ Override public void onAuthFail ( SocializeException error ) { holder . remove ( listenerKey ) ; listener . onAuthFail ( error ) ; } @ Override public void onCancel ( ) { holder . remove ( listenerKey ) ; listener . onCancel ( ) ; } } ) ; Intent i = new Intent ( context , FacebookActivity . class ) ; i . putExtra ( "appId" , info . getAppId ( ) ) ; i . putExtra ( "sso" , sso ) ; i . putExtra ( "type" , info . getPermissionType ( ) . toString ( ) ) ; switch ( info . getPermissionType ( ) ) { case READ : if ( info . getReadPermissions ( ) != null ) { i . putExtra ( "permissions" , info . getReadPermissions ( ) ) ; } break ; case WRITE : if ( info . getWritePermissions ( ) != null ) { i . putExtra ( "permissions" , info . getWritePermissions ( ) ) ; } break ; } context . startActivity ( i ) ;


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # link ( android . app . Activity , com . socialize . listener . SocializeAuthListener ) */
@ Deprecated @ Override public void link ( Activity context , SocializeAuthListener listener ) { } }

implementation: linkForWrite ( context , listener ) ;


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # link ( android . app . Activity , com . socialize . listener . SocializeAuthListener , java . lang . String [ ] ) */
@ Deprecated @ Override public void link ( Activity context , SocializeAuthListener listener , String ... permissions ) { } }

implementation: getSocialize ( ) . authenticate ( context , AuthProviderType . FACEBOOK , listener , permissions ) ;


signature:
public class BaseFacebookFacade { /** * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # getAccessToken ( android . content . Context ) */
@ Override public String getAccessToken ( Context context ) { } }

implementation: UserProviderCredentials creds = getSocialize ( ) . getSession ( ) . getUserProviderCredentials ( AuthProviderType . FACEBOOK ) ; if ( creds != null ) { return creds . getAccessToken ( ) ; } return null ;


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # unlink ( android . content . Context , com . socialize . networks . SocializeDeAuthListener ) */
@ Override public void unlink ( final Context context , final SocializeDeAuthListener listener ) { } }

implementation:
// Clear the FB session
try { new AsyncTask < Void , Void , Void > ( ) { @ Override protected Void doInBackground ( Void ... params ) { try { SocializeSession session = getSocialize ( ) . getSession ( ) ; session . clear ( AuthProviderType . FACEBOOK ) ; UserSettings userSettings = session . getUserSettings ( ) ; if ( userSettings != null ) { userSettings . setAutoPostFacebook ( false ) ; } userSystem . saveSession ( context , session ) ; logout ( context ) ; if ( listener != null ) { listener . onSuccess ( ) ; } } catch ( Exception e ) { if ( listener != null ) { listener . onError ( SocializeException . wrap ( e ) ) ; } } return null ; } } . execute ( ) ; } catch ( Exception e ) { if ( logger != null ) { logger . error ( "Error while logging out of Facebook" , e ) ; } else { e . printStackTrace ( ) ; } }


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # postLike ( android . app . Activity , com . socialize . entity . Entity , com . socialize . entity . PropagationInfo , com . socialize . networks . SocialNetworkListener ) */
@ Override public void postLike ( Activity parent , Entity entity , PropagationInfo propInfo , SocialNetworkListener listener ) { } }

implementation: if ( config . isOGLike ( ) ) { Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "object" , propInfo . getEntityUrl ( ) ) ; post ( parent , "me/og.likes" , params , listener ) ; } else { post ( parent , entity , "" , propInfo , listener ) ; }


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # postEntity ( android . app . Activity , com . socialize . entity . Entity , java . lang . String , com . socialize . api . action . share . SocialNetworkShareListener ) */
@ Override public void postEntity ( Activity context , Entity entity , String text , SocialNetworkShareListener listener ) { } }

implementation: ShareOptions options = ShareUtils . getUserShareOptions ( context ) ; options . setText ( text ) ; options . setShowAuthDialog ( false ) ; ShareUtils . shareViaSocialNetworks ( context , entity , options , listener , SocialNetwork . FACEBOOK ) ;


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # postComment ( android . app . Activity , com . socialize . entity . Entity , java . lang . String , com . socialize . entity . PropagationInfo , com . socialize . networks . SocialNetworkListener ) */
@ Override public void postComment ( Activity parent , Entity entity , String comment , PropagationInfo propInfo , SocialNetworkListener listener ) { } }

implementation: post ( parent , entity , comment , propInfo , listener ) ;


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # postOG ( android . app . Activity , com . socialize . entity . Entity , java . lang . String , java . lang . String , com . socialize . entity . PropagationInfo , com . socialize . networks . SocialNetworkListener ) */
@ Override public void postOG ( Activity parent , Entity entity , String message , String action , PropagationInfo propInfo , SocialNetworkListener listener ) { } }

implementation: String entityUrl = propInfo . getEntityUrl ( ) ; String linkName = entityUrl ; String link = entityUrl ; if ( entity != null ) { linkName = entity . getDisplayName ( ) ; } final Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "name" , linkName ) ; params . put ( "message" , message ) ; params . put ( "link" , link ) ; params . put ( "type" , "link" ) ; DefaultPostData postData = new DefaultPostData ( ) ; postData . setPostValues ( params ) ; postData . setEntity ( entity ) ; postData . setPropagationInfo ( propInfo ) ; post ( parent , listener , postData ) ;


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # post ( android . app . Activity , com . socialize . entity . Entity , java . lang . String , com . socialize . entity . PropagationInfo , com . socialize . networks . SocialNetworkListener ) */
@ Override public void post ( Activity parent , Entity entity , String message , PropagationInfo propInfo , SocialNetworkListener listener ) { } }

implementation: postOG ( parent , entity , message , null , propInfo , listener ) ;


signature:
public class BaseFacebookFacade { /** * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # post ( android . app . Activity , com . socialize . networks . SocialNetworkListener , com . socialize . networks . PostData ) */
@ Override public void post ( Activity parent , SocialNetworkListener listener , PostData postData ) { } }

implementation: doFacebookCall ( parent , postData . getPostValues ( ) , "me/feed" , HttpMethod . POST , listener ) ;


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # post ( android . app . Activity , java . lang . String , java . util . Map , com . socialize . networks . SocialNetworkPostListener ) */
@ Override public void post ( Activity parent , String graphPath , Map < String , Object > postData , SocialNetworkPostListener listener ) { } }

implementation: doFacebookCall ( parent , postData , graphPath , HttpMethod . POST , listener ) ;


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # get ( android . app . Activity , java . lang . String , java . util . Map , com . socialize . networks . SocialNetworkPostListener ) */
@ Override public void get ( Activity parent , String graphPath , Map < String , Object > postData , SocialNetworkPostListener listener ) { } }

implementation: doFacebookCall ( parent , postData , graphPath , HttpMethod . GET , listener ) ;


signature:
public class BaseFacebookFacade { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookFacade # delete ( android . app . Activity , java . lang . String , java . util . Map , com . socialize . networks . SocialNetworkPostListener ) */
@ Override public void delete ( Activity parent , String graphPath , Map < String , Object > postData , SocialNetworkPostListener listener ) { } }

implementation: doFacebookCall ( parent , postData , graphPath , HttpMethod . DELETE , listener ) ;


signature:
public class DefaultShareMessageBuilder { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . ShareMessageBuilder # buildShareSubject ( com . socialize . entity . Entity ) */
@ Override public String buildShareSubject ( Entity entity ) { } }

implementation: String entityKey = entity . getKey ( ) ; String entityName = entity . getName ( ) ; StringBuilder builder = new StringBuilder ( ) ; SocializeSession session = getSocialize ( ) . getSession ( ) ; User currentUser = null ; if ( session != null ) { currentUser = session . getUser ( ) ; } String sharingText = localizationService . getString ( I18NConstants . SHARE_TEXT_SHARING ) ; String sharedText = localizationService . getString ( I18NConstants . SHARE_TEXT_SHARED ) ; if ( currentUser != null ) { String name = currentUser . getDisplayName ( ) ; if ( StringUtils . isEmpty ( name ) ) { builder . append ( sharingText ) ; builder . append ( " " ) ; } else { builder . append ( name ) ; builder . append ( " " ) ; builder . append ( sharedText ) ; builder . append ( " " ) ; } } else { builder . append ( sharingText ) ; builder . append ( " " ) ; } if ( ! StringUtils . isEmpty ( entityName ) ) { builder . append ( entityName ) ; } else { builder . append ( entityKey ) ; } return builder . toString ( ) ;


signature:
public class TwitterAuthView { /** * So we can mock */
protected ITwitterAuthWebView newTwitterAuthWebView ( Context context ) { } }

implementation: if ( twitterAuthWebViewFactory != null ) { return twitterAuthWebViewFactory . getBean ( ) ; } return new TwitterAuthWebView ( context ) ;


signature:
public class ShareDialogFactory { /** * / * ( non - Javadoc )
 * @ see com . socialize . ui . share . IShareDialogFactory # show ( android . content . Context , com . socialize . entity . Entity , com . socialize . networks . SocialNetworkListener , com . socialize . ui . share . ShareDialogListener , int ) */
@ Override public void show ( Context context , final Entity entity , final SocialNetworkListener socialNetworkListener , final ShareDialogListener shareDialoglistener , final int displayOptions ) { } }

implementation: showDialog ( context , new BeanCreationListener < SharePanelView > ( ) { @ Override public void onError ( String name , Exception e ) { } @ Override public void onCreate ( SharePanelView bean ) { bean . setSocialNetworkListener ( socialNetworkListener ) ; bean . setEntity ( entity ) ; bean . setShareDialogListener ( shareDialoglistener ) ; bean . setDisplayOptions ( displayOptions ) ; bean . applyDisplayOptions ( ) ; bean . updateNetworkButtonState ( ) ; } } , new ShareDialogListener ( ) { @ Override public void onShow ( Dialog dialog , SharePanelView dialogView ) { recordEvent ( "show" ) ; if ( shareDialoglistener != null ) { shareDialoglistener . onShow ( dialog , dialogView ) ; } } @ Override public void onSimpleShare ( ShareType type ) { recordEvent ( "share" , type . name ( ) ) ; if ( shareDialoglistener != null ) { shareDialoglistener . onSimpleShare ( type ) ; } } @ Override public void onCancel ( Dialog dialog ) { recordEvent ( "close" ) ; if ( shareDialoglistener != null ) { shareDialoglistener . onCancel ( dialog ) ; } } @ Override public boolean onContinue ( Dialog dialog , boolean remember , SocialNetwork ... networks ) { recordEvent ( "share" , networks ) ; return shareDialoglistener != null && shareDialoglistener . onContinue ( dialog , remember , networks ) ; } @ Override public void onFlowInterrupted ( DialogFlowController controller ) { if ( shareDialoglistener != null ) { shareDialoglistener . onFlowInterrupted ( controller ) ; } } } ) ;


signature:
public class ProfileSaveButtonListener { /** * / * ( non - Javadoc )
 * @ see android . view . View . OnClickListener # onClick ( android . view . View ) */
@ Override public void onClick ( View v ) { } }

implementation:
// Show a progress bar . . .
final ProgressDialog progress = progressDialogFactory . show ( context , I18NConstants . DLG_SETTINGS , I18NConstants . PLEASE_WAIT ) ; // Get the updated info
UserSettings profile = new UserSettings ( ) ; profile . setFirstName ( view . getFirstNameEdit ( ) . getText ( ) . toString ( ) . trim ( ) ) ; profile . setLastName ( view . getLastNameEdit ( ) . getText ( ) . toString ( ) . trim ( ) ) ; // Settings will only be changed if the image was altered
// See ProfileView # onImageChange
Drawable imageOn = view . getProfilePictureEditView ( ) . getProfileImage ( ) ; if ( imageOn instanceof BitmapDrawable ) { profile . setImage ( ( ( BitmapDrawable ) imageOn ) . getBitmap ( ) ) ; } if ( view . getAutoPostFacebook ( ) != null ) { profile . setAutoPostFacebook ( view . getAutoPostFacebook ( ) . isChecked ( ) ) ; } if ( view . getAutoPostTwitter ( ) != null ) { profile . setAutoPostTwitter ( view . getAutoPostTwitter ( ) . isChecked ( ) ) ; } if ( view . getNotificationsEnabledCheckbox ( ) != null ) { profile . setNotificationsEnabled ( view . getNotificationsEnabledCheckbox ( ) . isChecked ( ) ) ; } if ( view . getLocationEnabledCheckbox ( ) != null ) { profile . setLocationEnabled ( view . getLocationEnabledCheckbox ( ) . isChecked ( ) ) ; } profileSaver . save ( context , profile , new UserSaveListener ( ) { @ Override public void onError ( SocializeException error ) { progress . dismiss ( ) ; if ( errorHandler != null ) { errorHandler . handleError ( context , error ) ; } } @ Override public void onUpdate ( User entity ) { progress . dismiss ( ) ; context . setResult ( CommentActivity . PROFILE_UPDATE ) ; context . finish ( ) ; } } ) ;


signature:
public class GSONUtils { /** * / * ( non - Javadoc )
 * @ see com . socialize . util . JSONUtils # fromJSON ( java . lang . String ) */
@ Override public synchronized < T > T fromJSON ( String json , Class < T > cls ) { } }

implementation: return gson . fromJson ( json , cls ) ;


signature:
public class BaseNotificationMessageBuilder { /** * So we can mock */
protected PendingIntent getPendingIntent ( Context context , NotificationMessage message , Intent notificationIntent ) { } }

implementation: return PendingIntent . getActivity ( context , getNotificationId ( message ) , notificationIntent , PendingIntent . FLAG_CANCEL_CURRENT ) ;


signature:
public class BaseNotificationMessageBuilder { /** * So we can mock */
protected Notification newNotification ( int icon , String text , long time ) { } }

implementation: return new Notification ( icon , text , time ) ;


signature:
public class GooglePlusShareHandler { /** * / * ( non - Javadoc )
 * @ see com . socialize . share . ShareHandler # isAvailableOnDevice ( android . content . Context ) */
@ Override public boolean isAvailableOnDevice ( Context context ) { } }

implementation: try { context . getPackageManager ( ) . getPackageInfo ( PLUS_PACKAGE , 0 ) ; return true ; } catch ( NameNotFoundException e ) { return false ; }


signature:
public class GooglePlusShareHandler { /** * / * ( non - Javadoc )
 * @ see com . socialize . share . AbstractShareHandler # handle ( android . app . Activity , com . socialize . entity . SocializeAction , java . lang . String , com . socialize . entity . PropagationInfo , com . socialize . networks . SocialNetworkListener ) */
@ Override protected void handle ( Activity context , SocializeAction action , String text , PropagationInfo info , SocialNetworkListener listener ) throws Exception { } }

implementation: boolean shareCancelled = false ; Entity entity = action . getEntity ( ) ; HashMap < String , Object > postValues = new HashMap < String , Object > ( ) ; postValues . put ( ShareUtils . EXTRA_SUBJECT , shareMessageBuilder . buildShareSubject ( entity ) ) ; postValues . put ( ShareUtils . EXTRA_TEXT , shareMessageBuilder . buildShareMessage ( entity , info , text , false , true ) ) ; DefaultPostData postData = new DefaultPostData ( ) ; postData . setEntity ( entity ) ; postData . setPropagationInfo ( info ) ; postData . setPostValues ( postValues ) ; if ( listener != null ) { shareCancelled = listener . onBeforePost ( context , null , postData ) ; } if ( ! shareCancelled ) { String body = String . valueOf ( postValues . get ( ShareUtils . EXTRA_TEXT ) ) ; String subject = String . valueOf ( postValues . get ( ShareUtils . EXTRA_SUBJECT ) ) ; Intent shareIntent = new Intent ( ) . setAction ( Intent . ACTION_SEND ) ; shareIntent . addFlags ( Intent . FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET ) ; shareIntent . putExtra ( Intent . EXTRA_TEXT , body ) ; shareIntent . putExtra ( Intent . EXTRA_SUBJECT , subject ) ; shareIntent . setType ( "text/plain" ) ; shareIntent . setPackage ( PLUS_PACKAGE ) ; context . startActivity ( shareIntent ) ; } if ( listener != null ) { listener . onAfterPost ( context , null , null ) ; }


signature:
public class LikeUtils { /** * Records a like against the given entity for the current user . This method will also prompt the user to share their like .
 * @ param context The current context .
 * @ param entity The entity to be liked .
 * @ param listener A listener to handle the result . */
public static void like ( Activity context , Entity entity , LikeAddListener listener ) { } }

implementation: proxy . like ( context , entity , listener ) ;


signature:
public class LikeUtils { /** * Records a like against the given entity for the current user . This method will NOT prompt the user to share their like .
 * @ param context The current context .
 * @ param entity The entity to be liked .
 * @ param likeOptions Optional parameters for the like .
 * @ param listener A listener to handle the result .
 * @ param networks 0 or more networks on which to share the like . */
public static void like ( Activity context , Entity entity , LikeOptions likeOptions , LikeAddListener listener , SocialNetwork ... networks ) { } }

implementation: proxy . like ( context , entity , likeOptions , listener , networks ) ;


signature:
public class LikeUtils { /** * Removes a like previously created for the current user .
 * @ param context The current context .
 * @ param entityKey The entity that was liked .
 * @ param listener A listener to handle the result . */
public static void unlike ( Activity context , String entityKey , LikeDeleteListener listener ) { } }

implementation: proxy . unlike ( context , entityKey , listener ) ;


signature:
public class LikeUtils { /** * Retrieves a like for an entity and the current user .
 * @ param context The current context .
 * @ param entityKey The entity that was liked .
 * @ param listener A listener to handle the result . */
public static void getLike ( Activity context , String entityKey , LikeGetListener listener ) { } }

implementation: proxy . getLike ( context , entityKey , listener ) ;


signature:
public class LikeUtils { /** * Retrieves a like based on its ID .
 * @ param context The current context .
 * @ param id The id of the like .
 * @ param listener A listener to handle the result . */
public static void getLike ( Activity context , long id , LikeGetListener listener ) { } }

implementation: proxy . getLike ( context , id , listener ) ;


signature:
public class LikeUtils { /** * Determines if the given entity has been liked by the current user .
 * @ param context The current context .
 * @ param entityKey The entity that was liked .
 * @ param listener listener A listener to handle the result . */
public static void isLiked ( Activity context , String entityKey , IsLikedListener listener ) { } }


signature:
public class LikeUtils { /** * Lists all likes for the given user .
 * @ param context The current context .
 * @ param user The user for whom likes will be queried .
 * @ param start The first index ( for pagination ) , starting at 0
 * @ param end The last index ( for pagination )
 * @ param listener A listener to handle the result . */
public static void getLikesByUser ( Activity context , User user , int start , int end , LikeListListener listener ) { } }

implementation: proxy . getLikesByUser ( context , user , start , end , listener ) ;


signature:
public class LikeUtils { /** * Lists all likes for the given entity .
 * @ param context The current context .
 * @ param entityKey The entity for whom likes will be queried .
 * @ param start The first index ( for pagination ) , starting at 0
 * @ param end The last index ( for pagination )
 * @ param listener A listener to handle the result . */
public static void getLikesByEntity ( Activity context , String entityKey , int start , int end , LikeListListener listener ) { } }

implementation: proxy . getLikesByEntity ( context , entityKey , start , end , listener ) ;


signature:
public class LikeUtils { /** * Lists all likes for all entities /
 * @ param context The current context .
 * @ param start The first index ( for pagination ) , starting at 0
 * @ param end The last index ( for pagination )
 * @ param listener A listener to handle the result . */
public static void getLikesByApplication ( Activity context , int start , int end , LikeListListener listener ) { } }

implementation: proxy . getLikesByApplication ( context , start , end , listener ) ;


signature:
public class LikeUtils { /** * Turns a regular CompoundButton ( CheckBox , ToggleButton etc ) into a Socialize Like button .
 * @ param context The current context .
 * @ param button The button to be converted .
 * @ param entity The entity that is to be liked .
 * @ param listener A Listener to handle changes in button state . */
public static void makeLikeButton ( Activity context , CompoundButton button , Entity entity , LikeButtonListener listener ) { } }

implementation: proxy . makeLikeButton ( context , button , entity , listener ) ;


signature:
public class FacebookUtilsImpl { /** * DO NOT CALL */
@ Deprecated @ Override public synchronized Facebook getFacebook ( Context context ) { } }

implementation: if ( facebook == null ) { facebook = new Facebook ( config . getProperty ( SocializeConfig . FACEBOOK_APP_ID ) ) ; } return facebook ;


signature:
public class FacebookUtilsImpl { /** * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookUtilsProxy # linkForRead ( android . app . Activity , com . socialize . listener . SocializeAuthListener ) */
@ Override public void linkForRead ( Activity context , SocializeAuthListener listener , String ... permissions ) { } }

implementation: facebookFacade . linkForRead ( context , listener , permissions ) ;


signature:
public class FacebookUtilsImpl { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookUtilsProxy # link ( android . app . Activity , com . socialize . listener . SocializeAuthListener ) */
@ Deprecated @ Override public void link ( Activity context , SocializeAuthListener listener ) { } }

implementation: facebookFacade . link ( context , listener ) ;


signature:
public class FacebookUtilsImpl { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookUtilsProxy # link ( android . app . Activity , java . lang . String , com . socialize . listener . SocializeAuthListener ) */
@ Deprecated @ Override public void link ( final Activity context , final String token , final boolean verifyPermissions , final SocializeAuthListener listener ) { } }

implementation: facebookFacade . link ( context , token , verifyPermissions , listener ) ;


signature:
public class FacebookUtilsImpl { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookUtilsProxy # unlink ( android . app . Activity ) */
@ Override public void unlink ( final Context context , final SocializeDeAuthListener listener ) { } }

implementation: facebookFacade . unlink ( context , listener ) ;


signature:
public class FacebookUtilsImpl { /** * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookUtilsProxy # isLinkedForRead ( android . content . Context ) */
@ Override public boolean isLinkedForRead ( Context context , String ... permissions ) { } }

implementation: return facebookFacade . isLinkedForRead ( context , permissions ) ;


signature:
public class FacebookUtilsImpl { /** * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookUtilsProxy # isLinkedForWrite ( android . content . Context ) */
@ Override public boolean isLinkedForWrite ( Context context , String ... permissions ) { } }

implementation: return facebookFacade . isLinkedForWrite ( context , permissions ) ;


signature:
public class FacebookUtilsImpl { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookUtilsProxy # isAvailable ( android . content . Context ) */
@ Override public boolean isAvailable ( Context context ) { } }

implementation: return authProviderInfoBuilder . isSupported ( AuthProviderType . FACEBOOK ) && ( facebookFacade . getSDKMajorVersion ( ) == 2 || appUtils . isActivityAvailable ( context , "com.facebook.LoginActivity" ) ) ;


signature:
public class FacebookUtilsImpl { /** * / * ( non - Javadoc )
 * @ see com . socialize . networks . facebook . FacebookUtilsProxy # setAppId ( android . content . Context , java . lang . String ) */
@ Override public void setAppId ( Context context , String appId ) { } }

implementation: SocializeConfig config = ConfigUtils . getConfig ( context ) ; config . setFacebookAppId ( appId ) ;


signature: public class CheckIsLinkedActivity { @ Override protected void onResume ( ) { } }

implementation: super . onResume ( ) ; StringBuilder builder = new StringBuilder ( ) ; builder . append ( "isLinkedForRead:" ) . append ( FacebookUtils . isLinkedForRead ( this ) ) . append ( "\n\n" ) . append ( "isLinkedForWrite:" ) . append ( FacebookUtils . isLinkedForWrite ( this ) ) ; Toast . makeText ( this , builder . toString ( ) , Toast . LENGTH_LONG ) . show ( ) ;


signature:
public class CommentScrollListener { /** * / * ( non - Javadoc )
 * @ see android . widget . AbsListView . OnScrollListener # onScroll ( android . widget . AbsListView , int , int , int ) */
@ Override public void onScroll ( AbsListView view , int firstVisibleItem , int visibleItemCount , int totalItemCount ) { } }

implementation:
// what is the bottom item that is visible
int lastInScreen = firstVisibleItem + visibleItemCount ; boolean last = ( lastInScreen == totalItemCount ) ; if ( last && callback . hasMoreItems ( ) && ! callback . isLoading ( ) ) { // Get next set . . .
callback . onGetNextSet ( ) ; }


signature:
public class AbstractOAuthConsumer { /** * Helper method that adds any OAuth parameters to the given request
 * parameters which are missing from the current request but required for
 * signing . A good example is the oauth _ nonce parameter , which is typically
 * not provided by the client in advance .
 * It ' s probably not a very good idea to override this method . If you want
 * to generate different nonces or timestamps , override
 * { @ link # generateNonce ( ) } or { @ link # generateTimestamp ( ) } instead .
 * @ param out
 * the request parameter which should be completed */
protected void completeOAuthParameters ( HttpParameters out ) { } }

implementation: if ( ! out . containsKey ( OAuth . OAUTH_CONSUMER_KEY ) ) { out . put ( OAuth . OAUTH_CONSUMER_KEY , consumerKey , true ) ; } if ( ! out . containsKey ( OAuth . OAUTH_SIGNATURE_METHOD ) ) { out . put ( OAuth . OAUTH_SIGNATURE_METHOD , messageSigner . getSignatureMethod ( ) , true ) ; } if ( ! out . containsKey ( OAuth . OAUTH_TIMESTAMP ) ) { out . put ( OAuth . OAUTH_TIMESTAMP , generateTimestamp ( ) , true ) ; } if ( ! out . containsKey ( OAuth . OAUTH_NONCE ) ) { out . put ( OAuth . OAUTH_NONCE , generateNonce ( ) , true ) ; } if ( ! out . containsKey ( OAuth . OAUTH_VERSION ) ) { out . put ( OAuth . OAUTH_VERSION , OAuth . VERSION_1_0 , true ) ; } if ( ! out . containsKey ( OAuth . OAUTH_TOKEN ) ) { if ( token != null && ! token . equals ( "" ) || sendEmptyTokens ) { out . put ( OAuth . OAUTH_TOKEN , token , true ) ; } }


signature:
public class AbstractOAuthConsumer { /** * Collects OAuth Authorization header parameters as per OAuth Core 1.0 spec
 * section 9.1.1 */
protected void collectHeaderParameters ( HttpRequest request , HttpParameters out ) { } }

implementation: HttpParameters headerParams = OAuth . oauthHeaderToParamsMap ( request . getHeader ( OAuth . HTTP_AUTHORIZATION_HEADER ) ) ; out . putAll ( headerParams , false ) ;


signature:
public class AbstractOAuthConsumer { /** * Collects x - www - form - urlencoded body parameters as per OAuth Core 1.0 spec
 * section 9.1.1 */
protected void collectBodyParameters ( HttpRequest request , HttpParameters out ) throws IOException { } }

implementation:
// collect x - www - form - urlencoded body params
String contentType = request . getContentType ( ) ; if ( contentType != null && contentType . startsWith ( OAuth . FORM_ENCODED ) ) { InputStream payload = request . getMessagePayload ( ) ; out . putAll ( OAuth . decodeForm ( payload ) , true ) ; }


signature:
public class AbstractOAuthConsumer { /** * Collects HTTP GET query string parameters as per OAuth Core 1.0 spec
 * section 9.1.1 */
protected void collectQueryParameters ( HttpRequest request , HttpParameters out ) { } }

implementation:
String url = request . getRequestUrl ( ) ; int q = url . indexOf ( '?' ) ; if ( q >= 0 ) { // Combine the URL query string with the other parameters :
out . putAll ( OAuth . decodeForm ( url . substring ( q + 1 ) ) , true ) ; }


signature:
public class Gson { /** * Returns the type adapter for { @ code } type .
 * @ throws IllegalArgumentException if this GSON cannot serialize and
 * deserialize { @ code type } . */
@ SuppressWarnings ( "unchecked" ) public < T > TypeAdapter < T > getAdapter ( TypeToken < T > type ) { } }

implementation:
TypeAdapter < ? > cached = typeTokenCache . get ( type ) ; if ( cached != null ) { return ( TypeAdapter < T > ) cached ; } Map < TypeToken < ? > , FutureTypeAdapter < ? > > threadCalls = calls . get ( ) ; // the key and value type parameters always agree
FutureTypeAdapter < T > ongoingCall = ( FutureTypeAdapter < T > ) threadCalls . get ( type ) ; if ( ongoingCall != null ) { return ongoingCall ; } FutureTypeAdapter < T > call = new FutureTypeAdapter < T > ( ) ; threadCalls . put ( type , call ) ; try { for ( TypeAdapterFactory factory : factories ) { TypeAdapter < T > candidate = factory . create ( this , type ) ; if ( candidate != null ) { call . setDelegate ( candidate ) ; typeTokenCache . put ( type , candidate ) ; return candidate ; } } throw new IllegalArgumentException ( "GSON cannot handle " + type ) ; } finally { threadCalls . remove ( type ) ; }


signature:
public class Gson { /** * TODO : needs documentation
 * @ since 2.2 */
public < T > TypeAdapter < T > getNextAdapter ( TypeAdapterFactory skipPast , TypeToken < T > type ) { } }

implementation: boolean skipPastFound = false ; for ( TypeAdapterFactory factory : factories ) { if ( ! skipPastFound ) { if ( factory == skipPast ) { skipPastFound = true ; } continue ; } TypeAdapter < T > candidate = factory . create ( this , type ) ; if ( candidate != null ) { return candidate ; } } throw new IllegalArgumentException ( "GSON cannot serialize " + type ) ;


signature:
public class Gson { /** * Writes the JSON representation of { @ code src } of type { @ code typeOfSrc } to
 * { @ code writer } .
 * @ throws JsonIOException if there was a problem writing to the writer */
@ SuppressWarnings ( "unchecked" ) public void toJson ( Object src , Type typeOfSrc , JsonWriter writer ) throws JsonIOException { } }

implementation: TypeAdapter < ? > adapter = getAdapter ( TypeToken . get ( typeOfSrc ) ) ; boolean oldLenient = writer . isLenient ( ) ; writer . setLenient ( true ) ; boolean oldHtmlSafe = writer . isHtmlSafe ( ) ; writer . setHtmlSafe ( htmlSafe ) ; boolean oldSerializeNulls = writer . getSerializeNulls ( ) ; writer . setSerializeNulls ( serializeNulls ) ; try { ( ( TypeAdapter < Object > ) adapter ) . write ( writer , src ) ; } catch ( IOException e ) { throw new JsonIOException ( e ) ; } finally { writer . setLenient ( oldLenient ) ; writer . setHtmlSafe ( oldHtmlSafe ) ; writer . setSerializeNulls ( oldSerializeNulls ) ; }


signature:
public class Gson { /** * Writes out the equivalent JSON for a tree of { @ link JsonElement } s .
 * @ param jsonElement root of a tree of { @ link JsonElement } s
 * @ param writer Writer to which the Json representation needs to be written
 * @ throws JsonIOException if there was a problem writing to the writer
 * @ since 1.4 */
public void toJson ( JsonElement jsonElement , Appendable writer ) throws JsonIOException { } }

implementation: try { JsonWriter jsonWriter = newJsonWriter ( Streams . writerForAppendable ( writer ) ) ; toJson ( jsonElement , jsonWriter ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; }


signature:
public class Gson { /** * Returns a new JSON writer configured for this GSON and with the non - execute
 * prefix if that is configured . */
private JsonWriter newJsonWriter ( Writer writer ) throws IOException { } }

implementation: if ( generateNonExecutableJson ) { writer . write ( JSON_NON_EXECUTABLE_PREFIX ) ; } JsonWriter jsonWriter = new JsonWriter ( writer ) ; if ( prettyPrinting ) { jsonWriter . setIndent ( "  " ) ; } jsonWriter . setSerializeNulls ( serializeNulls ) ; return jsonWriter ;


signature:
public class Gson { /** * Writes the JSON for { @ code jsonElement } to { @ code writer } .
 * @ throws JsonIOException if there was a problem writing to the writer */
public void toJson ( JsonElement jsonElement , JsonWriter writer ) throws JsonIOException { } }

implementation: boolean oldLenient = writer . isLenient ( ) ; writer . setLenient ( true ) ; boolean oldHtmlSafe = writer . isHtmlSafe ( ) ; writer . setHtmlSafe ( htmlSafe ) ; boolean oldSerializeNulls = writer . getSerializeNulls ( ) ; writer . setSerializeNulls ( serializeNulls ) ; try { Streams . write ( jsonElement , writer ) ; } catch ( IOException e ) { throw new JsonIOException ( e ) ; } finally { writer . setLenient ( oldLenient ) ; writer . setHtmlSafe ( oldHtmlSafe ) ; writer . setSerializeNulls ( oldSerializeNulls ) ; }


signature:
public class Gson { /** * Reads the next JSON value from { @ code reader } and convert it to an object
 * of type { @ code typeOfT } .
 * Since Type is not parameterized by T , this method is type unsafe and should be used carefully
 * @ throws JsonIOException if there was a problem writing to the Reader
 * @ throws JsonSyntaxException if json is not a valid representation for an object of type */
@ SuppressWarnings ( "unchecked" ) public < T > T fromJson ( JsonReader reader , Type typeOfT ) throws JsonIOException , JsonSyntaxException { } }

implementation:
boolean isEmpty = true ; boolean oldLenient = reader . isLenient ( ) ; reader . setLenient ( true ) ; try { reader . peek ( ) ; isEmpty = false ; TypeAdapter < T > typeAdapter = ( TypeAdapter < T > ) getAdapter ( TypeToken . get ( typeOfT ) ) ; return typeAdapter . read ( reader ) ; } catch ( EOFException e ) { /* * For compatibility with JSON 1.5 and earlier , we return null for empty
 * documents instead of throwing . */
if ( isEmpty ) { return null ; } throw new JsonSyntaxException ( e ) ; } catch ( IllegalStateException e ) { throw new JsonSyntaxException ( e ) ; } catch ( IOException e ) { // TODO ( inder ) : Figure out whether it is indeed right to rethrow this as JsonSyntaxException
throw new JsonSyntaxException ( e ) ; } finally { reader . setLenient ( oldLenient ) ; }


signature:
public class TweetActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( final String text ) { } }

implementation:
TwitterUtils . link ( this , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( TweetActivity . this , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAuthSuccess ( SocializeSession session ) { Tweet tweet = new Tweet ( ) ; tweet . setText ( text ) ; tweet . setLocation ( LocationUtils . getLastKnownLocation ( TweetActivity . this ) ) ; tweet . setShareLocation ( true ) ; TwitterUtils . tweet ( TweetActivity . this , tweet , new SocialNetworkListener ( ) { @ Override public boolean onBeforePost ( Activity parent , SocialNetwork socialNetwork , PostData postData ) { // Nothing to see here . . move along .
return false ; } @ Override public void onNetworkError ( Activity context , SocialNetwork network , Exception error ) { handleError ( TweetActivity . this , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAfterPost ( Activity parent , SocialNetwork socialNetwork , JSONObject responseObject ) { handleResult ( responseObject . toString ( ) ) ; } } ) ; } @ Override public void onAuthFail ( SocializeException error ) { handleError ( TweetActivity . this , error ) ; } } ) ;


signature:
public class TypeAdapter { /** * Converts { @ code value } to a JSON document . Unlike Gson ' s similar { @ link
 * Gson # toJson ( Object ) toJson } method , this write is strict . Create a { @ link
 * JsonWriter # setLenient ( boolean ) lenient } { @ code JsonWriter } and call
 * { @ link # write ( com . socialize . google . gson . stream . JsonWriter , Object ) } for lenient
 * writing .
 * @ param value the Java object to convert . May be null .
 * @ since 2.2 */
public final String toJson ( T value ) throws IOException { } }

implementation: StringWriter stringWriter = new StringWriter ( ) ; toJson ( stringWriter , value ) ; return stringWriter . toString ( ) ;


signature:
public class SocializeBaseView { /** * Subclasses override */
public void onViewLoad ( IOCContainer container ) { } }

implementation:
// Create a menu if we have one .
if ( menu != null ) { createOptionsMenuItem ( getActivity ( ) , menu ) ; } viewLoaded = true ;


signature:
public class GetCommentsByIDActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation:
// We are going to list comments just so we can get the ID for a single comment
// Usually you would NOT do this as you would usually already have an ID ( e . g . from a click on a list view )
CommentUtils . getCommentsByEntity ( this , entity . getKey ( ) , 0 , 1 , new CommentListListener ( ) { @ Override public void onList ( ListResult < Comment > comments ) { // Use the id from the first comment
if ( comments . getTotalCount ( ) > 0 ) { CommentUtils . getComment ( GetCommentsByIDActivity . this , new CommentGetListener ( ) { @ Override public void onGet ( Comment comment ) { handleSocializeResult ( comment ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetCommentsByIDActivity . this , error ) ; } } , comments . getItems ( ) . get ( 0 ) . getId ( ) ) ; } } @ Override public void onError ( SocializeException error ) { handleError ( GetCommentsByIDActivity . this , error ) ; } } ) ;


signature: public class GetEmailActivity { private void onFacebookBtnClicked ( ) { } }

implementation:
// defaults found in : com . socialize . networks . facebook . BaseFacebookFacade
String [ ] permissions = { "email" } ; FacebookUtils . linkForRead ( this , new SocializeAuthListener ( ) { @ Override public void onCancel ( ) { Toast . makeText ( GetEmailActivity . this , "Facebook login cancelled" , Toast . LENGTH_SHORT ) . show ( ) ; } @ Override public void onAuthSuccess ( SocializeSession session ) { getFaceBookUserEmailetc ( ) ; } @ Override public void onAuthFail ( SocializeException error ) { handleError ( GetEmailActivity . this , error ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetEmailActivity . this , error ) ; } } , permissions ) ;


signature: public class GetEmailActivity { private void getFaceBookUserEmailetc ( ) { } }

implementation:
String graphPath = "/me" ; // Execute a GET on facebook
// The " this " argument refers to the current Activity
FacebookUtils . get ( this , graphPath , null , new SocialNetworkPostListener ( ) { @ Override public void onCancel ( ) { Toast . makeText ( GetEmailActivity . this , "Facebook get cancelled" , Toast . LENGTH_SHORT ) . show ( ) ; } @ Override public void onNetworkError ( Activity context , SocialNetwork network , Exception error ) { handleError ( GetEmailActivity . this , error ) ; } @ Override public void onAfterPost ( Activity parent , SocialNetwork socialNetwork , JSONObject responseObject ) { if ( responseObject . has ( "email" ) && ! responseObject . isNull ( "email" ) ) { try { handleResult ( responseObject . getString ( "email" ) ) ; } catch ( JSONException e ) { handleError ( GetEmailActivity . this , e ) ; } } else { handleResult ( "Unable to retrieve email address!\n\n" + responseObject . toString ( ) ) ; } } } ) ;


signature:
public class ConstructorConstructor { /** * Constructors for common interface types like Map and List and their
 * subytpes . */
@ SuppressWarnings ( "unchecked" ) // use runtime checks to guarantee that ' T ' is what it is
private < T > ObjectConstructor < T > newDefaultImplementationConstructor ( Class < ? super T > rawType ) { } }

implementation:
if ( Collection . class . isAssignableFrom ( rawType ) ) { if ( SortedSet . class . isAssignableFrom ( rawType ) ) { return new ObjectConstructor < T > ( ) { public T construct ( ) { return ( T ) new TreeSet < Object > ( ) ; } } ; } else if ( Set . class . isAssignableFrom ( rawType ) ) { return new ObjectConstructor < T > ( ) { public T construct ( ) { return ( T ) new LinkedHashSet < Object > ( ) ; } } ; } else if ( Queue . class . isAssignableFrom ( rawType ) ) { return new ObjectConstructor < T > ( ) { public T construct ( ) { return ( T ) new LinkedList < Object > ( ) ; } } ; } else { return new ObjectConstructor < T > ( ) { public T construct ( ) { return ( T ) new ArrayList < Object > ( ) ; } } ; } } if ( Map . class . isAssignableFrom ( rawType ) ) { return new ObjectConstructor < T > ( ) { public T construct ( ) { return ( T ) new LinkedHashMap < Object , Object > ( ) ; } } ; // TODO : SortedMap ?
} return null ;


signature:
public class SimpleNotificationMessageTranslator { /** * / * ( non - Javadoc )
 * @ see com . socialize . notifications . MessageTranslator # translate ( android . content . Context , android . os . Bundle , com . socialize . notifications . NotificationMessage ) */
@ Override public SimpleNotificationMessage translate ( Context context , NotificationMessage message ) throws SocializeException { } }

implementation: SimpleNotificationMessage msg = newSimpleNotificationMessage ( ) ; StringBuilder titleBuilder = newStringBuilder ( ) ; titleBuilder . append ( message . getUser ( ) ) ; switch ( message . getActionType ( ) ) { case COMMENT : titleBuilder . append ( " commented on " ) ; break ; case SHARE : titleBuilder . append ( " shared " ) ; break ; case LIKE : titleBuilder . append ( " liked " ) ; break ; case VIEW : titleBuilder . append ( " viewed " ) ; break ; } titleBuilder . append ( message . getEntity ( ) ) ; msg . setTitle ( titleBuilder . toString ( ) ) ; msg . setText ( message . getText ( ) ) ; return msg ;


signature:
public class PropagationFactory { /** * / * ( non - Javadoc )
 * @ see com . socialize . entity . JSONFactory # toJSON ( java . lang . Object , org . json . JSONObject ) */
@ Override protected void toJSON ( Propagation from , JSONObject to ) throws JSONException { } }

implementation:
// Make params
Map < String , String > extraParams = from . getExtraParams ( ) ; if ( extraParams != null && extraParams . size ( ) > 0 ) { Set < Entry < String , String > > entrySet = extraParams . entrySet ( ) ; if ( entrySet != null && entrySet . size ( ) > 0 ) { int count = 0 ; StringBuilder builder = new StringBuilder ( ) ; for ( Entry < String , String > entry : entrySet ) { String key = entry . getKey ( ) ; String value = entry . getValue ( ) ; if ( ! StringUtils . isEmpty ( key ) && ! StringUtils . isEmpty ( value ) ) { if ( count > 0 ) { builder . append ( "&" ) ; } builder . append ( URLEncoder . encode ( key ) ) ; builder . append ( "=" ) ; builder . append ( URLEncoder . encode ( value ) ) ; count ++ ; } } to . put ( "extra_params" , builder . toString ( ) ) ; } } JSONArray networks = new JSONArray ( ) ; List < ShareType > thirdParties = from . getThirdParties ( ) ; if ( thirdParties != null && thirdParties . size ( ) > 0 ) { for ( ShareType socialNetwork : thirdParties ) { networks . put ( socialNetwork . name ( ) . toLowerCase ( ) ) ; } to . put ( "third_parties" , networks ) ; }


signature:
public class StringUtils { /** * Replaces successive new line characters .
 * @ param src The source String .
 * @ param from Number of successive new lines ( e . g . 3 would be \ n \ n \ n )
 * @ param to The number of new lines to replace with .
 * @ return The cleaned string . */
public static String replaceNewLines ( String src , int from , int to ) { } }

implementation: if ( src != null && from > 0 && to < from ) { String strFrom = "" ; String strTo = "" ; for ( int i = 0 ; i < from ; i ++ ) { strFrom += "\n" ; } for ( int i = 0 ; i < to ; i ++ ) { strTo += "\n" ; } while ( src . contains ( strFrom ) ) { src = src . replaceAll ( strFrom , strTo ) ; } } return src ;


signature:
public class GetSharesByUserActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: try { ShareUtils . getSharesByUser ( this , UserUtils . getCurrentUser ( this ) , 0 , PAGE_SIZE , new ShareListListener ( ) { @ Override public void onList ( ListResult < Share > shares ) { handleSocializeResult ( shares ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetSharesByUserActivity . this , error ) ; } } ) ; } catch ( SocializeException e ) { e . printStackTrace ( ) ; }


signature:
public class SocializeEventSystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . event . EventSystem # addEvent ( com . socialize . api . SocializeSession , com . socialize . api . event . SocializeEvent , com . socialize . api . event . EventListener ) */
@ Override public void addEvent ( SocializeSession session , SocializeEvent event , EventListener eventListener ) { } }

implementation: postAsync ( session , ENDPOINT , event , false , eventListener ) ;


signature:
public class AuthDialogFactory { /** * / * ( non - Javadoc )
 * @ see com . socialize . ui . auth . IAuthDialogFactory # show ( android . content . Context , com . socialize . ui . auth . AuthDialogListener ) */
@ Override public void show ( Context context , final AuthDialogListener listener , final boolean required ) { } }

implementation: showDialog ( context , new BeanCreationListener < AuthPanelView > ( ) { @ Override public void onError ( String name , Exception e ) { } @ Override public void onCreate ( AuthPanelView bean ) { bean . setAuthDialogListener ( listener ) ; bean . setAuthRequired ( required ) ; } } , new AuthDialogListener ( ) { @ Override public void onShow ( Dialog dialog , AuthPanelView dialogView ) { recordEvent ( "show" ) ; if ( listener != null ) { listener . onShow ( dialog , dialogView ) ; } } @ Override public void onCancel ( Dialog dialog ) { recordEvent ( "cancel" ) ; if ( listener != null ) { listener . onCancel ( dialog ) ; } } @ Override public void onSkipAuth ( Activity context , Dialog dialog ) { recordEvent ( "skip" ) ; if ( listener != null ) { listener . onSkipAuth ( context , dialog ) ; } } @ Override public void onError ( Activity context , Dialog dialog , Exception error ) { recordEvent ( "error" ) ; if ( listener != null ) { listener . onError ( context , dialog , error ) ; } } @ Override public void onAuthenticate ( Activity context , Dialog dialog , SocialNetwork network ) { recordEvent ( "auth" , network . name ( ) ) ; if ( listener != null ) { listener . onAuthenticate ( context , dialog , network ) ; } } } ) ;


signature:
public class ActionBarReload { /** * end - snippet - 0 */
void reload ( ) { } }

implementation:
// begin - snippet - 1
// The in the Activity which renders the ActionBar
Entity entity = Entity . newInstance ( "http://getsocialize.com" , "Socialize" ) ; // Setup a listener to retain a reference
MyActionBarListener listener = new MyActionBarListener ( ) ; // Use the listener when you show the action bar
// The " this " argument refers to the current Activity
ActionBarUtils . showActionBar ( this , R . layout . actionbar , entity , null , listener ) ; // Later ( After the action bar has loaded ! ) , you can reference the view to refresh
ActionBarView view = listener . getActionBarView ( ) ; if ( view != null ) { Entity newEntity = new Entity ( ) ; // This would be your new entity
view . setEntity ( newEntity ) ; view . refresh ( ) ; } // end - snippet - 1


signature:
public class DirectUrlMessageTranslator { /** * ( non - Javadoc )
 * @ see com . socialize . notifications . MessageTranslator # translateTo ( android . content . Context , android . os . Bundle , com . socialize . notifications . NotificationMessage ) */
@ Override public SimpleNotificationMessage translate ( Context context , Bundle data , NotificationMessage message ) throws SocializeException { } }

implementation: SimpleNotificationMessage notify = new SimpleNotificationMessage ( ) ; notify . setTitle ( message . getText ( ) ) ; String url = message . getUrl ( ) ; if ( url != null ) { notify . setText ( url ) ; data . putString ( Socialize . DIRECT_URL , url ) ; } else { throw new SocializeException ( "No url found in notification of type [" + message . getNotificationType ( ) + "]" ) ; } return notify ;


signature:
public class GetLikesByUserActivity { /** * / * ( non - Javadoc )
 * @ see com . socialize . demo . DemoActivity # executeDemo ( ) */
@ Override public void executeDemo ( String text ) { } }

implementation: try { LikeUtils . getLikesByUser ( this , UserUtils . getCurrentUser ( this ) , 0 , PAGE_SIZE , new LikeListListener ( ) { @ Override public void onList ( List < Like > items , int totalSize ) { handleSocializeResult ( items ) ; } @ Override public void onError ( SocializeException error ) { handleError ( GetLikesByUserActivity . this , error ) ; } } ) ; } catch ( SocializeException e ) { e . printStackTrace ( ) ; }


signature:
public class GeoUtils { /** * Returns a simple one - line address based on city and country
 * @ param address
 * @ return */
public String getSimpleLocation ( Address address ) { } }

implementation: StringBuilder builder = new StringBuilder ( ) ; String locality = address . getLocality ( ) ; String countryName = address . getCountryName ( ) ; if ( ! StringUtils . isEmpty ( locality ) ) { builder . append ( locality ) ; } else if ( ! StringUtils . isEmpty ( countryName ) ) { builder . append ( countryName ) ; } return builder . toString ( ) ;


signature:
public class SocializeUserSystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . UserSystem # getUser ( com . socialize . api . SocializeSession , long , com . socialize . listener . user . UserListener ) */
@ Override public void getUser ( SocializeSession session , long id , UserListener listener ) { } }

implementation: getAsync ( session , ENDPOINT , String . valueOf ( id ) , listener ) ;


signature:
public class SocializeUserSystem { /** * / * ( non - Javadoc )
 * @ see com . socialize . api . action . UserSystem # saveUserProfile ( android . content . Context , com . socialize . api . SocializeSession , com . socialize . ui . profile . UserProfile , com . socialize . listener . user . UserListener ) */
@ Override public void saveUserSettings ( final Context context , final SocializeSession session , final UserSettings settingsToBeSaved , final UserListener listener ) { } }

implementation:
User sessionUser = session . getUser ( ) ; UserSettings sessionSettings = session . getUserSettings ( ) ; boolean wasNotificationsEnabled = sessionSettings . isNotificationsEnabled ( ) ; // Update the settings and the user in the session so they are saved
sessionUser . setFirstName ( settingsToBeSaved . getFirstName ( ) ) ; sessionUser . setLastName ( settingsToBeSaved . getLastName ( ) ) ; sessionSettings . update ( settingsToBeSaved ) ; boolean isNotificationsEnabled = sessionSettings . isNotificationsEnabled ( ) ; if ( settingsToBeSaved . getImage ( ) != null ) { sessionUser . setProfilePicData ( bitmapUtils . encode ( settingsToBeSaved . getImage ( ) ) ) ; } // If notifications was not previously enabled , we may need to register .
if ( isNotificationsEnabled && ! wasNotificationsEnabled && notificationRegistrationSystem != null ) { notificationRegistrationSystem . registerC2DMAsync ( context ) ; } saveUserAsync ( context , session , sessionUser , listener ) ;


signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected void login ( Activity context , boolean read , final AuthProviderListener listener ) { } }

implementation: login ( context , config . getProperty ( SocializeConfig . FACEBOOK_APP_ID ) , ( read ) ? READ_PERMISSIONS : WRITE_PERMISSIONS , config . getBooleanProperty ( SocializeConfig . FACEBOOK_SSO_ENABLED , true ) , read , listener ) ;


signature:
public class FacebookFacadeV3 { /** * So we can mock */
protected Session createNewSession ( Activity context , String appId ) { } }

implementation: return new Session . Builder ( context ) . setApplicationId ( appId ) . build ( ) ;


signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected void login ( Activity context , String appId , String [ ] permissions , boolean sso , boolean read , final AuthProviderListener listener ) { } }

implementation: Session . OpenRequest auth = new Session . OpenRequest ( context ) ; if ( permissions != null ) { auth . setPermissions ( Arrays . asList ( permissions ) ) ; } if ( sso ) { auth . setLoginBehavior ( SessionLoginBehavior . SSO_WITH_FALLBACK ) ; } else { auth . setLoginBehavior ( SessionLoginBehavior . SUPPRESS_SSO ) ; } auth . setCallback ( createLoginCallback ( listener ) ) ; Session session = createNewSession ( context , appId ) ; Session . setActiveSession ( session ) ; if ( read ) { openSessionForRead ( session , auth ) ; } else { openSessionForPublish ( session , auth ) ; }


signature:
public class FacebookFacadeV3 { /** * So we can mock */
protected Session . StatusCallback createLoginCallback ( final AuthProviderListener listener ) { } }

implementation:
return new Session . StatusCallback ( ) { // callback when session changes state
@ Override public void call ( final Session session , SessionState state , Exception exception ) { if ( exception != null && exception instanceof FacebookOperationCanceledException ) { if ( logger != null ) { logger . error ( "Facebook operation failed" , exception ) ; } handleCancel ( listener ) ; return ; } switch ( state ) { case OPENED : if ( isSessionOpen ( session ) ) { // make request to the / me API
getUser ( session , listener ) ; } break ; case CLOSED : if ( exception != null ) { handleError ( exception , listener ) ; } break ; case CLOSED_LOGIN_FAILED : if ( exception != null ) { handleAuthFail ( exception , listener ) ; } break ; } } } ;


signature:
public class FacebookFacadeV3 { /** * so we can mock */
protected void getUser ( final Session session , final AuthProviderListener listener ) { } }

implementation:
Request . executeMeRequestAsync ( session , new Request . GraphUserCallback ( ) { // callback after Graph API response with user object
@ Override public void onCompleted ( GraphUser user , Response response ) { if ( response . getError ( ) != null ) { handleError ( response . getError ( ) . getException ( ) , listener ) ; } else if ( user != null ) { handleResult ( session , user , listener ) ; } } } ) ;


signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected void handleError ( Exception exception , SocializeListener listener ) { } }

implementation: if ( listener != null ) { listener . onError ( SocializeException . wrap ( exception ) ) ; }


signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected void handleAuthFail ( Exception exception , AuthProviderListener listener ) { } }

implementation: if ( listener != null ) { listener . onAuthFail ( SocializeException . wrap ( exception ) ) ; }


signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected void handleResult ( Session session , GraphUser user , AuthProviderListener listener ) { } }

implementation: if ( listener != null ) { AuthProviderResponse response = new AuthProviderResponse ( ) ; response . setUserId ( user . getId ( ) ) ; response . setToken ( session . getAccessToken ( ) ) ; listener . onAuthSuccess ( response ) ; }


signature:
public class FacebookFacadeV3 { /** * Protected so we can mock */
protected Session getActiveSession ( Context context ) { } }

implementation: Session activeSession = Session . getActiveSession ( ) ; if ( activeSession == null ) { activeSession = new Session . Builder ( context ) . setApplicationId ( config . getProperty ( SocializeConfig . FACEBOOK_APP_ID ) ) . build ( ) ; Session . setActiveSession ( activeSession ) ; } return activeSession ;