Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

JBRULES-3009 Make Enum Class Builder extensible

  • Loading branch information...
commit d578862ceabbc9582cc0d46760f2d11cc23cd0bb 1 parent bc18b61
@sotty authored etirelli committed
View
16 drools-core/src/main/java/org/drools/factmodel/DefaultEnumClassBuilder.java
@@ -128,17 +128,17 @@ public DefaultEnumClassBuilder(final boolean debug) {
- private void buildClassHeader(ClassWriter cw, EnumClassDefinition classDef) {
+ protected void buildClassHeader(ClassWriter cw, EnumClassDefinition classDef) {
cw.visit( V1_5,
ACC_PUBLIC + ACC_FINAL + ACC_SUPER + ACC_ENUM,
BuildUtils.getInternalType( classDef.getClassName() ),
"Ljava/lang/Enum<" + BuildUtils.getTypeDescriptor( classDef.getClassName() ) + ">;",
BuildUtils.getInternalType( classDef.getSuperClass() ),
- null);
+ BuildUtils.getInternalTypes( classDef.getInterfaces() ) );
}
- private void buildLiterals(ClassWriter cw, EnumClassDefinition classDef) {
+ protected void buildLiterals(ClassWriter cw, EnumClassDefinition classDef) {
FieldVisitor fv;
for ( EnumLiteralDefinition lit : classDef.getEnumLiterals() ) {
fv = cw.visitField( ACC_PUBLIC + ACC_FINAL + ACC_STATIC + ACC_ENUM,
@@ -160,7 +160,7 @@ private void buildLiterals(ClassWriter cw, EnumClassDefinition classDef) {
}
- private void buildFields(ClassWriter cw, EnumClassDefinition classDef) {
+ protected void buildFields(ClassWriter cw, EnumClassDefinition classDef) {
FieldVisitor fv;
for ( FieldDefinition fld : classDef.getFieldsDefinitions() ) {
fv = cw.visitField( ACC_PRIVATE + ACC_FINAL,
@@ -178,7 +178,7 @@ private void buildFields(ClassWriter cw, EnumClassDefinition classDef) {
}
- private void buildConstructors(ClassWriter cw, EnumClassDefinition classDef) throws IOException, ClassNotFoundException {
+ protected void buildConstructors(ClassWriter cw, EnumClassDefinition classDef) throws IOException, ClassNotFoundException {
MethodVisitor mv;
String argTypes = "";
int size = 0;
@@ -326,7 +326,7 @@ private void buildConstructors(ClassWriter cw, EnumClassDefinition classDef) thr
- private void buildGettersAndSetters(ClassWriter cw, EnumClassDefinition classDef) {
+ protected void buildGettersAndSetters(ClassWriter cw, EnumClassDefinition classDef) {
MethodVisitor mv;
{
mv = cw.visitMethod( ACC_PUBLIC + ACC_STATIC,
@@ -399,12 +399,12 @@ private void buildGettersAndSetters(ClassWriter cw, EnumClassDefinition classDef
}
}
- private void buildToString(ClassWriter cw, EnumClassDefinition classDef) {
+ protected void buildToString(ClassWriter cw, EnumClassDefinition classDef) {
}
- private void buildEqualityMethods(ClassWriter cw, ClassDefinition classDef) {
+ protected void buildEqualityMethods(ClassWriter cw, ClassDefinition classDef) {
}
Please sign in to comment.
Something went wrong with that request. Please try again.