Package com.yahoo.protect
Class ClassValidator
java.lang.Object
com.yahoo.protect.ClassValidator
Static utility methods to validate class properties.
Do note, this class will not be a reliable guarantee for correctness if you have a forest of methods only differing by return type (as contradistinguished from name and argument types), the current implementation is minimal.
- Author:
- Steinar Knutsen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionunmaskedMethods
(Class<?> testClass, Class<?> maskedClass) Check all protected, public and package private declared methods of maskedClass is implemented in testClass.unmaskedMethodsFromSuperclass
(Class<?> testClass) Check testClass overrides all protected, public and package private methods of its immediate super class.
-
Constructor Details
-
ClassValidator
public ClassValidator()
-
-
Method Details
-
unmaskedMethods
Check all protected, public and package private declared methods of maskedClass is implemented in testClass. Note, this will by definition blow up on final methods in maskedClass.- Parameters:
testClass
- class which wraps or masks another classmaskedClass
- class which is masked or wrapped- Returns:
- the methods which seem to miss from testClass to be complete
-
unmaskedMethodsFromSuperclass
Check testClass overrides all protected, public and package private methods of its immediate super class. See unmaskedMethods().- Parameters:
testClass
- the class to check whether completely masks its super class- Returns:
- the methods missing from testClass to completely override its immediate super class
-