How to force a child class to declare a specific inner class
<p>I'm wringing my brains to try to find a simple way to force a child class to declare another type of child class. For instance, I've got</p>

<pre><code>public final class MessageType1 extends MessageType {
    public static final class Subtypes extends MessageSubtypes {
         public static int SOME_SUBTYPE = 1;
    }
}


public final class MessageType2 extends MessageType {
    public static final class Subtypes extends MessageSubtypes {
         public static int ANOTHER_SUBTYPE = 1;
    }
}

public abstract class MessageType {
    public static abstract class MessageSubtypes {
        public static int ALL_SUBTYPES = 0;
    }
}
</code></pre>

<p>Is there a way to ensure that every child of MessageType has to create its own version of MessageSubtypes and name it Subtypes?</p>

<p>Or maybe I'm spinning in the wrong circles and there's a better way to do this. Basically I'm just wanting to ensure that all of my message types have their own set of unique subtypes and that each subtype has a member called ALL whose value is 0. Creating a MessageType without a subtype should not compile, but if that's not possible it should at least not be usable, and throw an exception if it occurs.</p>
