Update of /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/predicates
In directory sc8-pr-cvs1:/tmp/cvs-serv12630/src/java/xdoclet/util/predicates
Modified Files:
HasClassTag.java IsA.java Not.java Or.java
PredicateFactory.java ReflectionPredicate.java
SimplePredicateFactory.java True.java
Log Message:
Removed the need for xdoclet-plugin.xml. All metadata is now in generated BeanInfo.
Index: HasClassTag.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/predicates/HasClassTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** HasClassTag.java 7 Mar 2003 09:15:11 -0000 1.3
--- HasClassTag.java 16 Mar 2003 17:06:58 -0000 1.4
***************
*** 3,7 ****
* All rights reserved.
*/
-
package xdoclet.util.predicates;
--- 3,6 ----
Index: IsA.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/predicates/IsA.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** IsA.java 7 Mar 2003 09:15:12 -0000 1.4
--- IsA.java 16 Mar 2003 17:06:58 -0000 1.5
***************
*** 3,7 ****
* All rights reserved.
*/
-
package xdoclet.util.predicates;
--- 3,6 ----
Index: Not.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/predicates/Not.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Not.java 7 Mar 2003 09:15:12 -0000 1.3
--- Not.java 16 Mar 2003 17:06:58 -0000 1.4
***************
*** 3,7 ****
* All rights reserved.
*/
-
package xdoclet.util.predicates;
--- 3,6 ----
Index: Or.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/predicates/Or.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Or.java 7 Mar 2003 09:15:12 -0000 1.3
--- Or.java 16 Mar 2003 17:06:58 -0000 1.4
***************
*** 3,7 ****
* All rights reserved.
*/
-
package xdoclet.util.predicates;
--- 3,6 ----
Index: PredicateFactory.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/predicates/PredicateFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** PredicateFactory.java 5 Mar 2003 22:27:11 -0000 1.2
--- PredicateFactory.java 16 Mar 2003 17:06:58 -0000 1.3
***************
*** 18,27 ****
public interface PredicateFactory {
/**
! * Creates a Predicate by name.
! *
! * @param name a logical name for a predicate
! * @return An instance of Predicate
! * @exception PredicateException If there is no registered Predicate for name.
! */
Predicate createPredicate(String name)
throws PredicateException;
--- 18,27 ----
public interface PredicateFactory {
/**
! * Creates a Predicate by name.
! *
! * @param name a logical name for a predicate
! * @return An instance of Predicate
! * @exception PredicateException If there is no registered Predicate for name.
! */
Predicate createPredicate(String name)
throws PredicateException;
Index: ReflectionPredicate.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/predicates/ReflectionPredicate.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ReflectionPredicate.java 9 Mar 2003 16:16:36 -0000 1.2
--- ReflectionPredicate.java 16 Mar 2003 17:06:58 -0000 1.3
***************
*** 1,6 ****
package xdoclet.util.predicates;
- import xjavadoc.predicates.ProgramElementPredicate;
import xjavadoc.XProgramElement;
import java.lang.reflect.Method;
--- 1,6 ----
package xdoclet.util.predicates;
import xjavadoc.XProgramElement;
+ import xjavadoc.predicates.ProgramElementPredicate;
import java.lang.reflect.Method;
***************
*** 30,37 ****
// Find the method. We only support methods with no arguments that return a
boolean.
Method method = null;
try {
method = programElement.getClass().getMethod(_methodName, null);
! }
! catch (Exception e) {
throw new IllegalStateException(_methodName + " should be a no-arg
method (" + e.getMessage() + ")");
}
--- 30,37 ----
// Find the method. We only support methods with no arguments that return a
boolean.
Method method = null;
+
try {
method = programElement.getClass().getMethod(_methodName, null);
! } catch (Exception e) {
throw new IllegalStateException(_methodName + " should be a no-arg
method (" + e.getMessage() + ")");
}
***************
*** 40,56 ****
Class returnType = method.getReturnType();
if (returnType != Boolean.TYPE) {
throw new IllegalStateException(_methodName + " should return boolean");
}
Boolean bool = null;
try {
bool = (Boolean) method.invoke(programElement, null);
! }
! catch (Exception e) {
e.printStackTrace();
throw new IllegalStateException("Failed to invoke " + _methodName);
}
boolean result = bool.booleanValue();
! result = _negation ? !result : result;
return result;
}
--- 40,61 ----
Class returnType = method.getReturnType();
+
if (returnType != Boolean.TYPE) {
throw new IllegalStateException(_methodName + " should return boolean");
}
+
Boolean bool = null;
+
try {
bool = (Boolean) method.invoke(programElement, null);
! } catch (Exception e) {
e.printStackTrace();
throw new IllegalStateException("Failed to invoke " + _methodName);
}
+
boolean result = bool.booleanValue();
!
! result = _negation ? (!result) : result;
!
return result;
}
***************
*** 62,73 ****
*/
public void setMethodName(String methodName) {
! if (methodName == null) throw new IllegalArgumentException("methodName
cannot be null");
! if (methodName.trim().length() == 0) throw new
IllegalArgumentException("methodName cannot be empty");
if (methodName.charAt(0) == '!') {
_negation = true;
_methodName = methodName.substring(1);
! }
! else {
_negation = false;
_methodName = methodName;
--- 67,82 ----
*/
public void setMethodName(String methodName) {
! if (methodName == null) {
! throw new IllegalArgumentException("methodName cannot be null");
! }
!
! if (methodName.trim().length() == 0) {
! throw new IllegalArgumentException("methodName cannot be empty");
! }
if (methodName.charAt(0) == '!') {
_negation = true;
_methodName = methodName.substring(1);
! } else {
_negation = false;
_methodName = methodName;
Index: SimplePredicateFactory.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/predicates/SimplePredicateFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** SimplePredicateFactory.java 7 Mar 2003 09:15:12 -0000 1.3
--- SimplePredicateFactory.java 16 Mar 2003 17:06:58 -0000 1.4
***************
*** 53,57 ****
* @throws PredicateException If the requested predicate is not registered.
*/
! public Predicate createPredicate(String name) throws PredicateException {
if (name == null) {
throw new IllegalArgumentException("name cannot be null");
--- 53,58 ----
* @throws PredicateException If the requested predicate is not registered.
*/
! public Predicate createPredicate(String name)
! throws PredicateException {
if (name == null) {
throw new IllegalArgumentException("name cannot be null");
***************
*** 68,76 ****
// Instantiate the predicate and return it
return (Predicate) clazz.newInstance();
! }
! catch (IllegalAccessException e) {
throw new PredicateException(e.getMessage(), e);
! }
! catch (InstantiationException e) {
throw new PredicateException(e.getMessage(), e);
}
--- 69,75 ----
// Instantiate the predicate and return it
return (Predicate) clazz.newInstance();
! } catch (IllegalAccessException e) {
throw new PredicateException(e.getMessage(), e);
! } catch (InstantiationException e) {
throw new PredicateException(e.getMessage(), e);
}
Index: True.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/predicates/True.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** True.java 7 Mar 2003 09:15:12 -0000 1.3
--- True.java 16 Mar 2003 17:06:58 -0000 1.4
***************
*** 3,7 ****
* All rights reserved.
*/
-
package xdoclet.util.predicates;
--- 3,6 ----
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel