• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VisibilityAnnotationTag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中soot.tagkit.VisibilityAnnotationTag的典型用法代码示例。如果您正苦于以下问题:Java VisibilityAnnotationTag类的具体用法?Java VisibilityAnnotationTag怎么用?Java VisibilityAnnotationTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VisibilityAnnotationTag类属于soot.tagkit包,在下文中一共展示了VisibilityAnnotationTag类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getVisibilityParameterAnnotationAttr

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
private String getVisibilityParameterAnnotationAttr(VisibilityParameterAnnotationTag tag){
    StringBuffer sb = new StringBuffer();
    sb.append(".param ");
    if (tag.getKind() == AnnotationConstants.RUNTIME_VISIBLE){
        sb.append(".runtime_visible_annotation\n");
    }
    else {
        sb.append(".runtime_invisible_annotation\n");
    }
    ArrayList<VisibilityAnnotationTag> vis_list = tag.getVisibilityAnnotations();
    if (vis_list != null){
        for (VisibilityAnnotationTag vat : vis_list) {
        	VisibilityAnnotationTag safeVat = vat == null
        			? getSafeVisibilityAnnotationTag(tag.getKind()) : vat;
            sb.append(getVisibilityAnnotationAttr(safeVat));
        }
    }
    sb.append(".end .param\n");
    return sb.toString();    
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:21,代码来源:AbstractJasminClass.java


示例2: visitAnnotation

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
/**
 * @see FieldVisitor#visitAnnotation(String, boolean)
 * @see MethodVisitor#visitAnnotation(String, boolean)
 * @see ClassVisitor#visitAnnotation(String, boolean)
 */
public AnnotationVisitor visitAnnotation(final String desc, boolean visible) {
	VisibilityAnnotationTag tag;
	if (visible) {
		tag = visibleTag;
		if (tag == null) {
			visibleTag = tag = new VisibilityAnnotationTag(AnnotationConstants.RUNTIME_VISIBLE);
			host.addTag(tag);
		}
	} else {
		tag = invisibleTag;
		if (tag == null) {
			invisibleTag = tag = new VisibilityAnnotationTag(AnnotationConstants.RUNTIME_INVISIBLE);
			host.addTag(tag);
		}
	}
	scb.addDep(AsmUtil.toQualifiedName(desc.substring(1, desc.length() - 1)));
	final VisibilityAnnotationTag _tag = tag;
	return new AnnotationElemBuilder() {
		@Override
		public void visitEnd() {
			AnnotationTag annotTag = new AnnotationTag(desc, elems);
			_tag.addAnnotation(annotTag);
		}
	};
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:31,代码来源:TagBuilder.java


示例3: parseFieldTags

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public static LinkedList<SootAnnotations.Annotation> parseFieldTags(SootField sf) {
	List<Tag> tags = sf.getTags();
	LinkedList<SootAnnotations.Annotation> annot = null;
	for (Tag t : tags) {
		if (t instanceof VisibilityAnnotationTag) {
			if (annot!=null) {
				throw new RuntimeException("Bug in parseFieldTags");
			}
			annot = parseAnnotations((VisibilityAnnotationTag)t);
		} else if (t instanceof SignatureTag) {
			//TODO: do we want to do something with that?
		} else if (t instanceof StringConstantValueTag) {
			
		} else if (t instanceof IntegerConstantValueTag) {

		} else {
			Log.debug("Unimplemented Tag found: "+t.getName());
		}
	}
	if (annot == null) annot = new LinkedList<SootAnnotations.Annotation>();
	return annot;
}
 
开发者ID:SRI-CSL,项目名称:bixie,代码行数:23,代码来源:SootAnnotations.java


示例4: parseParameterAnnotations

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public static LinkedList<LinkedList<SootAnnotations.Annotation>> parseParameterAnnotations(SootMethod m) {
	
	LinkedList<LinkedList<SootAnnotations.Annotation>> pannot = new LinkedList<LinkedList<SootAnnotations.Annotation>>();
	
	for (Tag t : m.getTags()) {
		if (t instanceof VisibilityParameterAnnotationTag) {
			VisibilityParameterAnnotationTag tag = (VisibilityParameterAnnotationTag)t;
			if (tag.getVisibilityAnnotations().size() != m.getParameterCount()) {
				throw new RuntimeException("number of tags does not match number of params ... I did not understand this part!");
			}				
			for (VisibilityAnnotationTag va : tag.getVisibilityAnnotations()) {					
				pannot.add(parseAnnotations(va));
			}
		} 
	}
	return pannot;

}
 
开发者ID:SRI-CSL,项目名称:bixie,代码行数:19,代码来源:SootAnnotations.java


示例5: parseAnnotations

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public void parseAnnotations(Unit u, int indx){
    Set<String> annotationName = LogicBloxAnnotExporter.annotationName;
    Map<Integer, List<Trio<String, String, String>>> pgmPtAnnot = LogicBloxAnnotExporter.pgmPtAnnot;
    if(pgmPtAnnot.containsKey(indx))
        return;
    List<Trio<String, String, String>> annots = new ArrayList<Trio<String, String, String>>();
    for(Tag t : u.getTags()){
        if(t instanceof VisibilityAnnotationTag){
            Map<String,List<Pair<String,String>>> parsed = SootUtilities.parseVisibilityAnnotationTag((VisibilityAnnotationTag)t);
            for(String annotName : parsed.keySet()){
                annotationName.add(annotName);
                List<Pair<String,String>> keyValues = parsed.get(annotName);
                for(Pair<String,String> p : keyValues){
                    annots.add(new Trio<String,String,String>(annotName,p.val0,p.val1));
                }
            }
        }else if(t instanceof LineNumberTag){
            LineNumberTag lnt = (LineNumberTag)t;
            annotationName.add("LineNumberTag");
            annots.add(new Trio<String,String,String>("LineNumberTag","LineNumber",Integer.toString(lnt.getLineNumber())) );
        }
    }
    pgmPtAnnot.put(indx, annots);
}
 
开发者ID:petablox-project,项目名称:petablox,代码行数:25,代码来源:DomP.java


示例6: parseAnnotations

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public void parseAnnotations(SootField f, int indx){
    Set<String> annotationName = LogicBloxAnnotExporter.annotationName;
    Map<Integer, List<Trio<String, String, String>>> fieldAnnot = LogicBloxAnnotExporter.fieldAnnot;
    if(fieldAnnot.containsKey(indx))
        return;
    List<Trio<String, String, String>> annots = new ArrayList<Trio<String, String, String>>();
    for(Tag t : f.getTags()){
        if(t instanceof VisibilityAnnotationTag){
            Map<String,List<Pair<String,String>>> parsed = SootUtilities.parseVisibilityAnnotationTag((VisibilityAnnotationTag)t);
            for(String annotName : parsed.keySet()){
                annotationName.add(annotName);
                List<Pair<String,String>> keyValues = parsed.get(annotName);
                for(Pair<String,String> p : keyValues){
                    annots.add(new Trio<String,String,String>(annotName,p.val0,p.val1));
                }
            }
        }
    }
    fieldAnnot.put(indx, annots);
}
 
开发者ID:petablox-project,项目名称:petablox,代码行数:21,代码来源:DomF.java


示例7: extractJUnitTestsHelper

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
protected List<SootMethod> extractJUnitTestsHelper(SootClass cl) {
    //System.out.println("prepare cl " + cl + ", tag_sz=" + cl.getTags().size() + ", cl.tags" + cl.getTags());

    ArrayList<SootMethod> testMethods = new ArrayList<SootMethod>();

    Iterator<SootMethod> it = cl.methodIterator();
    while (it.hasNext()) {
        SootMethod m = it.next();
        //System.out.println("method:" + m + ", isPublic:" + m.isPublic() +", isNative:" + m.isNative() + ", tags: " + m.getTags());
        boolean found = false;
        for(soot.tagkit.Tag tg : m.getTags()) {
            if(!found && tg instanceof soot.tagkit.VisibilityAnnotationTag) {
                VisibilityAnnotationTag vat = (VisibilityAnnotationTag) tg;
                for( AnnotationTag at : vat.getAnnotations()) {
                    //System.out.println("type: " + at.getType());
                    if(at.getType().equals("Lorg/junit/Test;")) {
                        found = true;
                        break;
                    }
                }
            }
        }
        if(found) testMethods.add(m);
    }
    return testMethods;
}
 
开发者ID:petablox-project,项目名称:petablox,代码行数:27,代码来源:RTA.java


示例8: parseVisibilityAnnotationTag

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public static Map<String,List<Pair<String,String>>> parseVisibilityAnnotationTag(VisibilityAnnotationTag v){
    Map<String,List<Pair<String,String>>> result = new HashMap<String,List<Pair<String,String>>>();
    List<AnnotationTag> aTags = v.getAnnotations();
    for(AnnotationTag a : aTags){
        String annotationName = a.getType();
        List<Pair<String,String>> elems = null;
        if(!result.containsKey(annotationName)){
            elems = new ArrayList<Pair<String,String>>();
            result.put(annotationName, elems);
        }else
            elems = result.get(annotationName);
        for(AnnotationElem ae : a.getElems()){
            if(ae.getKind() == 's'){
                AnnotationStringElem ase = (AnnotationStringElem)ae;
                Pair<String,String> keyValue = new Pair<String,String>(ase.getName(),ase.getValue());
                elems.add(keyValue);
            }
        }
    }
    return result;
}
 
开发者ID:petablox-project,项目名称:petablox,代码行数:22,代码来源:SootUtilities.java


示例9: parseFieldTags

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public static LinkedList<SootAnnotations.Annotation> parseFieldTags(SootField sf) {
	List<Tag> tags = sf.getTags();
	LinkedList<SootAnnotations.Annotation> annot = null;
	for (Tag t : tags) {
		if (t instanceof VisibilityAnnotationTag) {
			if (annot!=null) {
				throw new RuntimeException("Bug in parseFieldTags");
			}
			annot = parseAnnotations((VisibilityAnnotationTag)t);
		} else if (t instanceof SignatureTag) {
			//TODO: do we want to do something with that?
		} else if (t instanceof StringConstantValueTag) {
			
		} else if (t instanceof IntegerConstantValueTag) {

		} else {
			Log.error("Unimplemented Tag found: "+t.getName());
		}
	}
	if (annot == null) annot = new LinkedList<SootAnnotations.Annotation>();
	return annot;
}
 
开发者ID:martinschaef,项目名称:jar2bpl,代码行数:23,代码来源:SootAnnotations.java


示例10: extractClassEffects

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public final List<ILevel> extractClassEffects(SootClass sootClass) {
    try {
        VisibilityAnnotationTag vt =
            extractVisibilityAnnotationTag(sootClass);
        AnnotationTag at =
            extractAnnotationTagWithType(vt,
                                         getJNISignature(definition.getAnnotationClassEffects()));
        SootAnnotationDAO dao =
            new SootAnnotationDAO(definition.getAnnotationClassEffects(),
                                  at);
        return definition.extractEffects(dao);
    } catch (AnnotationExtractionException
            | AnnotationElementNotFoundException e) {
        throw new AnnotationExtractionException(getMsg("exception.annotation.extract_class_effects_error",
                                                       getSignatureOfClass(sootClass)),
                                                e);
    }

}
 
开发者ID:proglang,项目名称:jgs,代码行数:20,代码来源:ALevelMediator.java


示例11: extractConstraints

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public final Set<LEQConstraint> extractConstraints(SootMethod sootMethod) {
    try {
        VisibilityAnnotationTag vt =
            extractVisibilityAnnotationTag(sootMethod);
        AnnotationTag at =
            extractAnnotationTagWithType(vt,
                                         getJNISignature(definition.getAnnotationClassConstraints()));
        SootAnnotationDAO dao =
            new SootAnnotationDAO(definition.getAnnotationClassConstraints(),
                                  at);
        return definition.extractConstraints(dao, sootMethod.getSignature());
    } catch (AnnotationExtractionException
            | AnnotationElementNotFoundException
            | AnnotationInvalidConstraintsException e) {
        throw new AnnotationExtractionException(getMsg("exception.annotation.extract_method_constraints_error",
                                                       getSignatureOfMethod(sootMethod)),
                                                e);
    }
}
 
开发者ID:proglang,项目名称:jgs,代码行数:20,代码来源:ALevelMediator.java


示例12: extractFieldSecurityLevel

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public final List<ILevel> extractFieldSecurityLevel(SootField sootField) {
    try {
        VisibilityAnnotationTag vt =
            extractVisibilityAnnotationTag(sootField);
        AnnotationTag at =
            extractAnnotationTagWithType(vt,
                                         getJNISignature(definition.getAnnotationClassFieldLevel()));
        SootAnnotationDAO dao =
            new SootAnnotationDAO(definition.getAnnotationClassFieldLevel(),
                                  at);
        return definition.extractFieldLevel(dao);
    } catch (AnnotationExtractionException
            | AnnotationElementNotFoundException e) {
        throw new AnnotationExtractionException(getMsg("exception.annotation.extract_field_level_error",
                                                       getSignatureOfField(sootField)),
                                                e);
    }
}
 
开发者ID:proglang,项目名称:jgs,代码行数:19,代码来源:ALevelMediator.java


示例13: extractMethodEffects

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public final List<ILevel> extractMethodEffects(SootMethod sootMethod) {
    try {
        VisibilityAnnotationTag vt =
            extractVisibilityAnnotationTag(sootMethod);
        AnnotationTag at =
            extractAnnotationTagWithType(vt,
                                         getJNISignature(definition.getAnnotationClassEffects()));
        SootAnnotationDAO dao =
            new SootAnnotationDAO(definition.getAnnotationClassEffects(),
                                  at);
        return definition.extractEffects(dao);
    } catch (AnnotationExtractionException
            | AnnotationElementNotFoundException e) {
        throw new AnnotationExtractionException(getMsg("exception.annotation.extract_method_effects_error",
                                                       getSignatureOfMethod(sootMethod)),
                                                e);
    }
}
 
开发者ID:proglang,项目名称:jgs,代码行数:19,代码来源:ALevelMediator.java


示例14: extractParameterSecurityLevels

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public final List<ILevel> extractParameterSecurityLevels(SootMethod sootMethod) {
    try {
        VisibilityAnnotationTag vt =
            extractVisibilityAnnotationTag(sootMethod);
        AnnotationTag at =
            extractAnnotationTagWithType(vt,
                                         getJNISignature(definition.getAnnotationClassParameterLevel()));
        SootAnnotationDAO dao =
            new SootAnnotationDAO(definition.getAnnotationClassParameterLevel(),
                                  at);
        return definition.extractParameterLevels(dao);
    } catch (AnnotationExtractionException
            | AnnotationElementNotFoundException e) {
        throw new AnnotationExtractionException(getMsg("exception.annotation.extract_method_parameter_error",
                                                       getSignatureOfMethod(sootMethod)),
                                                e);
    }
}
 
开发者ID:proglang,项目名称:jgs,代码行数:19,代码来源:ALevelMediator.java


示例15: extractReturnSecurityLevel

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public final ILevel extractReturnSecurityLevel(SootMethod sootMethod) {
    try {
        VisibilityAnnotationTag vt =
            extractVisibilityAnnotationTag(sootMethod);
        AnnotationTag at =
            extractAnnotationTagWithType(vt,
                                         getJNISignature(definition.getAnnotationClassReturnLevel()));
        SootAnnotationDAO dao =
            new SootAnnotationDAO(definition.getAnnotationClassReturnLevel(),
                                  at);
        return definition.extractReturnLevel(dao);
    } catch (AnnotationExtractionException
            | AnnotationElementNotFoundException e) {
        throw new AnnotationExtractionException(getMsg("exception.annotation.extract_method_return_error",
                                                       getSignatureOfMethod(sootMethod)),
                                                e);
    }
}
 
开发者ID:proglang,项目名称:jgs,代码行数:19,代码来源:ALevelMediator.java


示例16: isAtomicAnnotated

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
public static boolean isAtomicAnnotated(SootMethod method)
{
    Tag tag=method.getTag("VisibilityAnnotationTag");

    if (tag == null)
        return false;

    VisibilityAnnotationTag visibilityAnnotationTag=(VisibilityAnnotationTag)tag;
    List<AnnotationTag> annotations=visibilityAnnotationTag.getAnnotations();

    for (AnnotationTag annotationTag: annotations)
        if (annotationTag.getType().endsWith("/"+ATOMIC_METHOD_ANNOTATION+";"))
            return true;

    return false;
}
 
开发者ID:trxsys,项目名称:gluon,代码行数:17,代码来源:AtomicityAnalysis.java


示例17: extractContractRaw

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
private String extractContractRaw()
{
     Tag tag=module.getTag("VisibilityAnnotationTag");

     if (tag == null)
        return null;

    VisibilityAnnotationTag visibilityAnnotationTag=(VisibilityAnnotationTag) tag;
    List<AnnotationTag> annotations=visibilityAnnotationTag.getAnnotations();

    for (AnnotationTag annotationTag: annotations)
        if (annotationTag.getType().endsWith("/"+CONTRACT_ANNOTATION+";")
            && annotationTag.getNumElems() == 1
            && annotationTag.getElemAt(0) instanceof AnnotationStringElem
            && annotationTag.getElemAt(0).getName().equals("clauses"))
        {
            AnnotationStringElem e=(AnnotationStringElem)annotationTag.getElemAt(0);

            return e.getValue();
        }

    return null;
}
 
开发者ID:trxsys,项目名称:gluon,代码行数:24,代码来源:Contract.java


示例18: buildFieldAnnotations

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
private Set<Annotation> buildFieldAnnotations(SootField f) {
	Set<String> skipList = new HashSet<String>();
	Set<Annotation> annotations = buildCommonAnnotations(f, skipList);
	
	for (Tag t : f.getTags()) {
        if (t.getName().equals("VisibilityAnnotationTag")){
            List<ImmutableAnnotation> visibilityItems = buildVisibilityAnnotationTag
            		((VisibilityAnnotationTag) t, skipList);
        	annotations.addAll(visibilityItems);
        }
	}
		
	return annotations;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:15,代码来源:DexPrinter.java


示例19: buildMethodAnnotations

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
private Set<Annotation> buildMethodAnnotations(SootMethod m) {
	Set<String> skipList = new HashSet<String>();
	Set<Annotation> annotations = buildCommonAnnotations(m, skipList);
	
	for (Tag t : m.getTags()) {
        if (t.getName().equals("VisibilityAnnotationTag")){
            List<ImmutableAnnotation> visibilityItems = buildVisibilityAnnotationTag
            		((VisibilityAnnotationTag) t, skipList);
        	annotations.addAll(visibilityItems);
        }
	}
	
	return annotations;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:15,代码来源:DexPrinter.java


示例20: for

import soot.tagkit.VisibilityAnnotationTag; //导入依赖的package包/类
private List<ImmutableAnnotation> buildVisibilityAnnotationTag
		(VisibilityAnnotationTag t, Set<String> skipList) {
   	if (t.getAnnotations() == null)
   		return Collections.emptyList();
   	
   	List<ImmutableAnnotation> annotations = new ArrayList<ImmutableAnnotation>();
       for (AnnotationTag at: t.getAnnotations()) {
           String type = at.getType();
           if (!skipList.add(type))
           	continue;
           
           Set<String> alreadyWritten = new HashSet<String>();
           List<AnnotationElement> elements = null;
           if (!at.getElems().isEmpty()) {
           	elements = new ArrayList<AnnotationElement>();
            for (AnnotationElem ae : at.getElems()) {
            	if (ae.getName() == null || ae.getName().isEmpty())
            		throw new RuntimeException("Null or empty annotation name encountered");
            	if (!alreadyWritten.add(ae.getName()))
            		throw new RuntimeException("Duplicate annotation attribute: " + ae.getName());
            	
                EncodedValue value = buildEncodedValueForAnnotation(ae);
                ImmutableAnnotationElement element = new ImmutableAnnotationElement
                		(ae.getName(), value);
                elements.add(element);
            }
           }
           
           String typeName = SootToDexUtils.getDexClassName(at.getType());
           ImmutableAnnotation ann = new ImmutableAnnotation(getVisibility(t.getVisibility()),
           		typeName, elements);
           annotations.add(ann);
       }
       return annotations;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:36,代码来源:DexPrinter.java



注:本文中的soot.tagkit.VisibilityAnnotationTag类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UnknownType类代码示例发布时间:2022-05-22
下一篇:
Java OServerConfiguration类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap