|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.codegen.util.PrivateAccessUtil
public class PrivateAccessUtil
Utility class with methods that generate code to access private, default access ("package private"), and protected methods and fields in arbitrary classes. Each generator allows the choice of generating Java Reflection code (for use on the server side) or JSNI code (for use on the client side).
Constructor Summary | |
---|---|
PrivateAccessUtil()
|
Method Summary | |
---|---|
static void |
addPrivateAccessStubs(PrivateAccessType accessType,
String type,
ClassStructureBuilder<?> classBuilder,
MetaField f)
Generates methods for accessing a private field using either JSNI or Java Reflection. |
static void |
addPrivateAccessStubs(PrivateAccessType accessType,
String accessorType,
ClassStructureBuilder<?> classBuilder,
MetaField f,
Modifier[] modifiers)
Generates methods for accessing a private field using either JSNI or Java Reflection. |
static void |
addPrivateAccessStubs(String accessorType,
ClassStructureBuilder<?> classBuilder,
MetaConstructor m)
Generates methods for accessing a nonpublic constructor using either JSNI or Java Reflection. |
static void |
addPrivateAccessStubs(String type,
ClassStructureBuilder<?> classBuilder,
MetaField f)
|
static void |
addPrivateAccessStubs(String accessorType,
ClassStructureBuilder<?> classBuilder,
MetaMethod m)
Generates methods for accessing a nonpublic method using either JSNI or Java Reflection. |
static void |
addPrivateAccessStubs(String accessorType,
ClassStructureBuilder<?> classBuilder,
MetaMethod m,
Modifier[] modifiers)
Generates methods for accessing a nonpublic method using either JSNI or Java Reflection. |
static String |
condensify(String packagePrefix)
|
static String |
getPrivateFieldInjectorName(MetaField field)
|
static String |
getPrivateMethodName(MetaMethod method)
|
static void |
registerPrivateMemberAccessor(String type,
PrivateMemberAccessor accessor)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrivateAccessUtil()
Method Detail |
---|
public static void registerPrivateMemberAccessor(String type, PrivateMemberAccessor accessor)
public static void addPrivateAccessStubs(String type, ClassStructureBuilder<?> classBuilder, MetaField f)
public static void addPrivateAccessStubs(PrivateAccessType accessType, String type, ClassStructureBuilder<?> classBuilder, MetaField f)
accessType
- Whether to generate a read method, a write method, or both.type
- The type of accessors to use (ie. "reflection" or "jsni").classBuilder
- The class builder to add the generated methods to.f
- The field the generated accessors read and write.public static void addPrivateAccessStubs(PrivateAccessType accessType, String accessorType, ClassStructureBuilder<?> classBuilder, MetaField f, Modifier[] modifiers)
accessType
- Whether to generate a read method, a write method, or both.accessorType
- The type of accessors to use (ie. "reflection" or "jsni").classBuilder
- The class builder to add the generated methods to.f
- The field the generated accessors read and write.modifiers
- The modifiers on the generated method, for example
Modifier.Final
or Modifier.Synchronized
. Never
specify Modifier.JSNI
; it is added automatically when
needed.public static void addPrivateAccessStubs(String accessorType, ClassStructureBuilder<?> classBuilder, MetaConstructor m)
getPrivateMethodName(MetaMethod)
.
accessorType
- The type of accessors to use (ie. "reflection" or "jsni").classBuilder
- The class builder to add the generated method to.m
- The constructor the generated method will invokepublic static void addPrivateAccessStubs(String accessorType, ClassStructureBuilder<?> classBuilder, MetaMethod m)
getPrivateMethodName(MetaMethod)
.
accessorType
- The type of accessors to use (ie. "reflection" or "jsni").classBuilder
- The class builder to add the generated method to.m
- The nonpublic method the generated method will invokepublic static void addPrivateAccessStubs(String accessorType, ClassStructureBuilder<?> classBuilder, MetaMethod m, Modifier[] modifiers)
accessorType
- The type of accessors to use (ie. "reflection" or "jsni").classBuilder
- The class builder to add the generated method to.m
- The method the generated accessors read and write.modifiers
- The modifiers on the generated method, for example
Modifier.Final
or Modifier.Synchronized
. Never
specify Modifier.JSNI
; it is added automatically when
needed.public static String condensify(String packagePrefix)
public static String getPrivateFieldInjectorName(MetaField field)
public static String getPrivateMethodName(MetaMethod method)
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |