Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ch.ethz.prose.crosscut
Class Wildcard  view Wildcard download Wildcard.java

java.lang.Object
  extended bych.ethz.prose.crosscut.Wildcard
Direct Known Subclasses:
ANY, REST

public abstract class Wildcard
extends java.lang.Object

Interface Wildcard is a placeholder for serveral classes or class lists at a time.

All classes implementing wildcard will have to provide a default constructor!

This is the expected way to use wildcards: if yourwildcard extends Wildcard, then ask your wildcard whether it is assignable from something else using:

 yourwildcard.newInstance().isAssignableFrom(String.class)
 

Version:
$Revision: 1.1.1.1 $

Field Summary
private  java.lang.Object contained
           
 
Constructor Summary
Wildcard()
           
 
Method Summary
 java.lang.Object getObject()
          Get the object last set with setObject.
abstract  boolean isAssignableFrom(java.lang.Class cls)
          Return true if this object supports the operation setObject with a parameter being an instance of the class cls.
abstract  boolean isAssignableFrom(java.lang.Class[] clsList)
          Return true if this object supports the operation setObject with a parameter being an array of objects, each of them having the class of the corresponding class in clsList.
 void setObject(java.lang.Object obj)
          Set the contents of this wildcard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contained

private java.lang.Object contained
Constructor Detail

Wildcard

public Wildcard()
Method Detail

isAssignableFrom

public abstract boolean isAssignableFrom(java.lang.Class cls)
Return true if this object supports the operation setObject with a parameter being an instance of the class cls.


isAssignableFrom

public abstract boolean isAssignableFrom(java.lang.Class[] clsList)
Return true if this object supports the operation setObject with a parameter being an array of objects, each of them having the class of the corresponding class in clsList.


setObject

public void setObject(java.lang.Object obj)
               throws java.lang.IllegalArgumentException
Set the contents of this wildcard. This should be used instead of assignments when using Wildcard classes.


getObject

public java.lang.Object getObject()
Get the object last set with setObject.