	public void addDeclareAnnotationRelationship(ISourceLocation sourceLocation, String typename,Method method) {
	  if (!AsmManager.isCreatingModel()) return;
	  String pkg  = null;
	  String type = typename;
	  int packageSeparator = typename.lastIndexOf(".");
	  if (packageSeparator!=-1) {
	 	pkg = typename.substring(0,packageSeparator);
	  	type = typename.substring(packageSeparator+1);
	  }
	  IProgramElement typeElem = AsmManager.getDefault().getHierarchy().findElementForType(pkg,type);
	  if (typeElem == null) return;
	  StringBuffer parmString = new StringBuffer("(");
	  Type[] args = method.getArgumentTypes();
	  for (int i = 0; i < args.length; i++) {
			Type type2 = args[i];
			String s = Utility.signatureToString(type2.getSignature());
			if (s.lastIndexOf(".")!=-1) s =s.substring(s.lastIndexOf(".")+1);
			parmString.append(s);
			if ((i+1)<args.length) parmString.append(",");
	  }
	  parmString.append(")");
	  IProgramElement methodElem = null;
	  if (method.getName().startsWith("<init>")) {
	  	methodElem = AsmManager.getDefault().getHierarchy().findElementForSignature(typeElem,IProgramElement.Kind.CONSTRUCTOR,type+parmString);
	  } else {
	  	methodElem = AsmManager.getDefault().getHierarchy().findElementForSignature(typeElem,IProgramElement.Kind.METHOD,method.getName()+parmString);
	  }
	  if (methodElem == null) return;
	  try {
	    String sourceHandle = 
            AsmManager.getDefault().getHandleProvider().createHandleIdentifier(sourceLocation.getSourceFile(),sourceLocation.getLine(),
		 	sourceLocation.getColumn(),sourceLocation.getOffset());
	    String targetHandle = methodElem.getHandleIdentifier();
	    IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
		if (sourceHandle != null && targetHandle != null) {
				IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATES,false,true);
				foreward.addTarget(targetHandle);
				IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATED_BY,false,true);
				back.addTarget(sourceHandle);
		}
        } catch (Throwable t) { 
          t.printStackTrace(); 
        }
	}

	public void addDeclareAnnotationRelationship(ISourceLocation sourceLocation, String typename,Method method) {
	  if (!AsmManager.isCreatingModel()) return;
	  String pkg  = null;
	  String type = typename;
	  int packageSeparator = typename.lastIndexOf(".");
	  if (packageSeparator!=-1) {
	 	pkg = typename.substring(0,packageSeparator);
	  	type = typename.substring(packageSeparator+1);
	  }
	  IProgramElement typeElem = AsmManager.getDefault().getHierarchy().findElementForType(pkg,type);
	  if (typeElem == null) return;
	  StringBuffer parmString = new StringBuffer("(");
	  Type[] args = method.getArgumentTypes();
	  for (int i = 0; i < args.length; i++) {
			Type type2 = args[i];
			String s = Utility.signatureToString(type2.getSignature());
			if (s.lastIndexOf(".")!=-1) s =s.substring(s.lastIndexOf(".")+1);
			parmString.append(s);
			if ((i+1)<args.length) parmString.append(",");
	  }
	  parmString.append(")");
	  IProgramElement methodElem = null;
	  if (method.getName().startsWith("<init>")) {
	  	methodElem = AsmManager.getDefault().getHierarchy().findElementForSignature(typeElem,IProgramElement.Kind.CONSTRUCTOR,type+parmString);
		if (methodElem == null && args.length==0) methodElem = typeElem; 
	  } else {
	  	methodElem = AsmManager.getDefault().getHierarchy().findElementForSignature(typeElem,IProgramElement.Kind.METHOD,method.getName()+parmString);
	  }
	  if (methodElem == null) return;
	  try {
	    String sourceHandle = 
            AsmManager.getDefault().getHandleProvider().createHandleIdentifier(sourceLocation.getSourceFile(),sourceLocation.getLine(),
		 	sourceLocation.getColumn(),sourceLocation.getOffset());
	    String targetHandle = methodElem.getHandleIdentifier();
	    IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
		if (sourceHandle != null && targetHandle != null) {
				IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATES,false,true);
				foreward.addTarget(targetHandle);
				IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATED_BY,false,true);
				back.addTarget(sourceHandle);
		}
        } catch (Throwable t) { 
          t.printStackTrace(); 
        }
	}
