public TypedSource(ISourceReference ref) throws JavaModelException{ this(SourceRangeComputer.computeSource(ref), ((IJavaElement)ref).getElementType()); Assert.isTrue(((IJavaElement)ref).getElementType() != IJavaElement.CLASS_FILE); Assert.isTrue(((IJavaElement)ref).getElementType() != IJavaElement.COMPILATION_UNIT);
public TypedSource(String source, int type){ Assert.isNotNull(source); Assert.isTrue(type == IJavaElement.FIELD || type == IJavaElement.TYPE || type == IJavaElement.IMPORT_CONTAINER || type == IJavaElement.IMPORT_DECLARATION || type == IJavaElement.INITIALIZER || type == IJavaElement.METHOD || type == IJavaElement.PACKAGE_DECLARATION); fSource= source; fType= type;
	public TypedSource(ISourceReference ref) throws JavaModelException{		this(SourceRangeComputer.computeSource(ref), ((IJavaElement)ref).getElementType());		Assert.isTrue(((IJavaElement)ref).getElementType() != IJavaElement.CLASS_FILE);		Assert.isTrue(((IJavaElement)ref).getElementType() != IJavaElement.COMPILATION_UNIT);	}