Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
Javadoc to describe plugin naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
cr0 committed Mar 4, 2015
1 parent d21204b commit ade3f38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,19 @@
* to the remote storage. Implementations must provide implementations for
* {@link TransferPlugin} (this class), {@link TransferSettings} (connection
* details) and {@link TransferManager} (transfer methods).<br/><br/>
* *

This comment has been minimized.

Copy link
@binwiederhier

binwiederhier Mar 5, 2015

Member

👍 Good stuff!

*<i>Plugins have to follow a naming convention</i>
* <ul>
* <li>Package names have to be lower snaked cased</li>
* <li>Class names have to be camel cased</li>
* <li>Package names will be converted to class names by replacing underscores ('_') and uppercasing the
* subsequent character.</li>
* </ul>
*
* <p>Links between the classes can be created by annotating this class with
* {@link org.syncany.plugins.transfer.PluginSettings} and {@link org.syncany.plugins.transfer.PluginManager},
* respectively.
* Example:
* A plugin is called DummyPlugin, hence <i>org.syncany.plugins.dummy_plugin.DummyPluginTransferPlugin</i> is the
* plugin's {@link TransferPlugin} class and <i>org.syncany.plugins.dummy_plugin.DummyPluginTransferSettings</i> is the
* corresponding {@link TransferSettings} implementation.
*
* @author Philipp C. Heckel <philipp.heckel@gmail.com>
* @author Christian Roth <christian.roth@port17.de>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
/**
* Helper class for {@link TransferPlugin}s, using to retrieve
* the required transfer plugin classes -- namely {@link TransferSettings},
* {@link TransferManager} and {@link TransferPlugin}. <br/>
* <br/>
* <i>Plugins have to follow convention</i>
* {@link TransferManager} and {@link TransferPlugin}.
*
* @author Christian Roth <christian.roth@port17.de>
*/
Expand Down Expand Up @@ -111,20 +109,20 @@ public static Class<? extends TransferPlugin> getTransferPluginClass(Class<? ext
}
}
}

/**
* Determines the {@link OAuthGenerator} class for the given class
* if an {@link OAuth} annotation is present.
*/
public static Class<? extends OAuthGenerator> getOAuthGeneratorClass(Class<? extends TransferSettings> clazz) {
OAuth oauthAnnotation = clazz.getAnnotation(OAuth.class);

if (oauthAnnotation != null) {
return oauthAnnotation.value();
}
else {
return null;
}
}
}

private static String getPluginPackageName(Class<?> clazz) {
Expand Down

0 comments on commit ade3f38

Please sign in to comment.