of_class: support custom template stanzas for of_match
diff --git a/java_gen/templates/custom/OFMatchV1Ver10.Builder.java b/java_gen/templates/custom/OFMatchV1Ver10.Builder.java
new file mode 100644
index 0000000..58afcd0
--- /dev/null
+++ b/java_gen/templates/custom/OFMatchV1Ver10.Builder.java
@@ -0,0 +1,77 @@
+
+    @Override
+    public <F extends OFValueType<F>> F get(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public boolean supports(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean supportsMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isExact(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isFullyWildcarded(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isPartiallyMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setExact(
+            MatchField<F> field, F value) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setMasked(
+            MatchField<F> field, F value, F mask) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setMasked(
+            MatchField<F> field, Masked<F> valueWithMask) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder wildcard(MatchField<F> field) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public Match getMatch() {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
diff --git a/java_gen/templates/custom/OFMatchV1Ver10.java b/java_gen/templates/custom/OFMatchV1Ver10.java
new file mode 100644
index 0000000..ec7bfcc
--- /dev/null
+++ b/java_gen/templates/custom/OFMatchV1Ver10.java
@@ -0,0 +1,44 @@
+
+    @Override
+    public <F extends OFValueType<F>> F get(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public boolean supports(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean supportsMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isExact(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isFullyWildcarded(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isPartiallyMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
diff --git a/java_gen/templates/custom/OFMatchV2Ver11.Builder.java b/java_gen/templates/custom/OFMatchV2Ver11.Builder.java
new file mode 100644
index 0000000..58afcd0
--- /dev/null
+++ b/java_gen/templates/custom/OFMatchV2Ver11.Builder.java
@@ -0,0 +1,77 @@
+
+    @Override
+    public <F extends OFValueType<F>> F get(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public boolean supports(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean supportsMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isExact(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isFullyWildcarded(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isPartiallyMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setExact(
+            MatchField<F> field, F value) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setMasked(
+            MatchField<F> field, F value, F mask) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setMasked(
+            MatchField<F> field, Masked<F> valueWithMask) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder wildcard(MatchField<F> field) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public Match getMatch() {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
diff --git a/java_gen/templates/custom/OFMatchV2Ver11.java b/java_gen/templates/custom/OFMatchV2Ver11.java
new file mode 100644
index 0000000..ec7bfcc
--- /dev/null
+++ b/java_gen/templates/custom/OFMatchV2Ver11.java
@@ -0,0 +1,44 @@
+
+    @Override
+    public <F extends OFValueType<F>> F get(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public boolean supports(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean supportsMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isExact(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isFullyWildcarded(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isPartiallyMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
diff --git a/java_gen/templates/custom/OFMatchV3Ver12.Builder.java b/java_gen/templates/custom/OFMatchV3Ver12.Builder.java
new file mode 100644
index 0000000..58afcd0
--- /dev/null
+++ b/java_gen/templates/custom/OFMatchV3Ver12.Builder.java
@@ -0,0 +1,77 @@
+
+    @Override
+    public <F extends OFValueType<F>> F get(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public boolean supports(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean supportsMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isExact(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isFullyWildcarded(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isPartiallyMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setExact(
+            MatchField<F> field, F value) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setMasked(
+            MatchField<F> field, F value, F mask) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setMasked(
+            MatchField<F> field, Masked<F> valueWithMask) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder wildcard(MatchField<F> field) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public Match getMatch() {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
diff --git a/java_gen/templates/custom/OFMatchV3Ver12.java b/java_gen/templates/custom/OFMatchV3Ver12.java
new file mode 100644
index 0000000..ec7bfcc
--- /dev/null
+++ b/java_gen/templates/custom/OFMatchV3Ver12.java
@@ -0,0 +1,44 @@
+
+    @Override
+    public <F extends OFValueType<F>> F get(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public boolean supports(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean supportsMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isExact(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isFullyWildcarded(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isPartiallyMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
diff --git a/java_gen/templates/custom/OFMatchV3Ver13.Builder.java b/java_gen/templates/custom/OFMatchV3Ver13.Builder.java
new file mode 100644
index 0000000..58afcd0
--- /dev/null
+++ b/java_gen/templates/custom/OFMatchV3Ver13.Builder.java
@@ -0,0 +1,77 @@
+
+    @Override
+    public <F extends OFValueType<F>> F get(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public boolean supports(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean supportsMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isExact(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isFullyWildcarded(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isPartiallyMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setExact(
+            MatchField<F> field, F value) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setMasked(
+            MatchField<F> field, F value, F mask) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder setMasked(
+            MatchField<F> field, Masked<F> valueWithMask) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> MatchBuilder wildcard(MatchField<F> field) {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public Match getMatch() {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
diff --git a/java_gen/templates/custom/OFMatchV3Ver13.java b/java_gen/templates/custom/OFMatchV3Ver13.java
new file mode 100644
index 0000000..ec7bfcc
--- /dev/null
+++ b/java_gen/templates/custom/OFMatchV3Ver13.java
@@ -0,0 +1,44 @@
+
+    @Override
+    public <F extends OFValueType<F>> F get(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
+            throws UnsupportedOperationException {
+        // FIXME yotam - please replace with real implementation
+        return null;
+    }
+
+    @Override
+    public boolean supports(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean supportsMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isExact(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isFullyWildcarded(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
+
+    @Override
+    public boolean isPartiallyMasked(MatchField<?> field) {
+        // FIXME yotam - please replace with real implementation
+        return false;
+    }
diff --git a/java_gen/templates/of_class.java b/java_gen/templates/of_class.java
index eae75ba..fb1d027 100644
--- a/java_gen/templates/of_class.java
+++ b/java_gen/templates/of_class.java
@@ -26,6 +26,7 @@
 //:: # under the EPL.
 //::
 //:: from loxi_ir import *
+//:: import os
 //:: import itertools
 //:: import of_g
 //:: include('_copyright.java')
@@ -64,6 +65,9 @@
     // Accessors for OF message fields
 //:: include("_field_accessors.java", msg=msg, generate_setters=False, builder=False)
 
+    //:: if os.path.exists("%s/custom/%s.java" % (template_dir, msg.name)):
+    //:: include("custom/%s.java" % msg.name, msg=msg)
+    //:: #endif
 
     public ${msg.interface.name}.Builder createBuilder() {
         return new BuilderWithParent(this);
@@ -92,6 +96,10 @@
                              for prop in msg.data_members])}
                     );
         }
+        //:: if os.path.exists("%s/custom/%s.Builder.java" % (template_dir, msg.name)):
+        //:: include("custom/%s.Builder.java" % msg.name, msg=msg)
+        //:: #endif
+
     }
 
     static class Builder implements ${msg.interface.name}.Builder {
@@ -111,6 +119,10 @@
                          for prop in msg.data_members])}
                 );
         }
+        //:: if os.path.exists("%s/custom/%s.Builder.java" % (template_dir, msg.name)):
+        //:: include("custom/%s.Builder.java" % msg.name, msg=msg)
+        //:: #endif
+
     }
 
     final static Reader READER = new Reader();