2006-11-22 17:38:46 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2002 - 2006 IBM Corporation.
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* IBM Corporation - initial API and implementation
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
package com.ibm.wala.classLoader;
|
|
|
|
|
|
|
|
import com.ibm.wala.ipa.cha.ClassHierarchy;
|
|
|
|
import com.ibm.wala.types.ClassLoaderReference;
|
|
|
|
import com.ibm.wala.types.TypeReference;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* A Class that exists nowhere in bytecode.
|
|
|
|
*
|
|
|
|
* @author sfink
|
|
|
|
*/
|
|
|
|
public abstract class SyntheticClass implements IClass {
|
|
|
|
|
|
|
|
private final TypeReference T;
|
2006-12-21 19:03:50 +00:00
|
|
|
|
2006-11-22 17:38:46 +00:00
|
|
|
private final ClassHierarchy cha;
|
|
|
|
/**
|
|
|
|
* @param T type reference describing this class
|
|
|
|
*/
|
|
|
|
public SyntheticClass(TypeReference T, ClassHierarchy cha) {
|
|
|
|
super();
|
|
|
|
this.T = T;
|
|
|
|
this.cha = cha;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* By default, a synthetic class is "loaded" by the primordial loader.
|
|
|
|
* Subclasses may override as necessary.
|
|
|
|
* @see com.ibm.wala.classLoader.IClass#getClassLoader()
|
|
|
|
*/
|
|
|
|
public IClassLoader getClassLoader() {
|
|
|
|
return cha.getLoader(ClassLoaderReference.Primordial);
|
|
|
|
}
|
|
|
|
|
2007-05-30 19:05:23 +00:00
|
|
|
/*
|
2006-11-22 17:38:46 +00:00
|
|
|
* @see com.ibm.wala.classLoader.IClass#isInterface()
|
|
|
|
*/
|
|
|
|
public boolean isInterface() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2007-05-30 19:05:23 +00:00
|
|
|
/*
|
2006-11-22 17:38:46 +00:00
|
|
|
* @see com.ibm.wala.classLoader.IClass#isAbstract()
|
|
|
|
*/
|
|
|
|
public boolean isAbstract() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2007-05-30 19:05:23 +00:00
|
|
|
/*
|
2006-11-22 17:38:46 +00:00
|
|
|
* @see com.ibm.wala.classLoader.IClass#getReference()
|
|
|
|
*/
|
|
|
|
public TypeReference getReference() {
|
|
|
|
return T;
|
|
|
|
}
|
|
|
|
|
2007-05-30 19:05:23 +00:00
|
|
|
/*
|
2006-11-22 17:38:46 +00:00
|
|
|
* @see com.ibm.wala.classLoader.IClass#getSourceFileName()
|
|
|
|
*/
|
|
|
|
public String getSourceFileName() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2007-05-30 19:05:23 +00:00
|
|
|
/*
|
2006-11-22 17:38:46 +00:00
|
|
|
* @see com.ibm.wala.classLoader.IClass#isArrayClass()
|
|
|
|
*/
|
|
|
|
public boolean isArrayClass() {
|
|
|
|
return false;
|
|
|
|
}
|
2006-12-21 19:03:50 +00:00
|
|
|
|
|
|
|
public ClassHierarchy getClassHierarchy() {
|
|
|
|
return cha;
|
|
|
|
}
|
2006-11-22 17:38:46 +00:00
|
|
|
}
|