001    /*******************************************************************************
002     * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 Sebastian
003     * Thomschke.
004     * 
005     * All Rights Reserved. This program and the accompanying materials
006     * are made available under the terms of the Eclipse Public License v1.0
007     * which accompanies this distribution, and is available at
008     * http://www.eclipse.org/legal/epl-v10.html
009     * 
010     * Contributors:
011     *     Sebastian Thomschke - initial implementation.
012     *******************************************************************************/
013    package net.sf.oval.context;
014    
015    /**
016     * @author Sebastian Thomschke
017     */
018    public class ClassContext extends OValContext
019    {
020            private static final long serialVersionUID = 1L;
021    
022            private final Class< ? > clazz;
023    
024            public ClassContext(final Class< ? > clazz)
025            {
026                    this.clazz = clazz;
027                    this.compileTimeType = clazz;
028            }
029    
030            /**
031             * @return the clazz
032             */
033            public Class< ? > getClazz()
034            {
035                    return clazz;
036            }
037    
038            /**
039             * {@inheritDoc}
040             */
041            @Override
042            public String toString()
043            {
044                    return clazz.getName();
045            }
046    }