SidedProxy now has sensible default values - nested ClientProxy and ServerProxy classes.

This commit is contained in:
RainWarrior committed 2016-01-02 09:59:14 +03:00
1 parent 40a124d571
commit d105c444ee
9 files changed
+36 -13

No files matched your search

@@ -57,6 +57,10 @@ public class ProxyInjector
continue;
}
String targetType = side.isClient() ? annotation.clientSide() : annotation.serverSide();
if(targetType.equals(""))
{
targetType = targ.getClassName() + (side.isClient() ? "$ClientProxy" : "$ServerProxy");
}
Object proxy=Class.forName(targetType, true, mcl).newInstance();
if (languageAdapter.supportsStatics() && (target.getModifiers() & Modifier.STATIC) == 0 )
@@ -50,12 +50,14 @@ import java.lang.annotation.Target;
public @interface SidedProxy
{
/**
* The name of the client side class to load and populate
* The full name of the client side class to load and populate.
* Defaults to the nested class named "ClientProxy" in the current class.
*/
String clientSide() default "";
/**
* The name of the server side class to load and populate
* The full name of the server side class to load and populate.
* Defaults to the nested class named "ServerProxy" in the current class.
*/
String serverSide() default "";