当前位置: 首页>>代码示例>>Java>>正文


Java ST.getAttributes方法代码示例

本文整理汇总了Java中org.stringtemplate.v4.ST.getAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java ST.getAttributes方法的具体用法?Java ST.getAttributes怎么用?Java ST.getAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.stringtemplate.v4.ST的用法示例。


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

示例1: addAttributeDescriptions

import org.stringtemplate.v4.ST; //导入方法依赖的package包/类
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:37,代码来源:JTreeScopeStackModel.java

示例2: addAttributeDescriptions

import org.stringtemplate.v4.ST; //导入方法依赖的package包/类
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length() >0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:37,代码来源:JTreeScopeStackModel.java

示例3: addAttributeDescriptions

import org.stringtemplate.v4.ST; //导入方法依赖的package包/类
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
    Map<String, Object> attrs = st.getAttributes();
    if ( attrs==null ) return;
    for (String a : attrs.keySet()) {
        String descr;
        if ( st.debugState !=null && st.debugState.addAttrEvents !=null ) {
            List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
            StringBuilder locations = new StringBuilder();
            int i = 0;
            if ( events!=null ) {
                for (AddAttributeEvent ae : events) {
                    if ( i>0 ) locations.append(", ");
                    locations.append(ae.getFileName()+":"+ae.getLine());
                    i++;
                }
            }
            if ( locations.length()>0 ) {
                descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
            }
            else {
                descr = a+" = "+attrs.get(a);
            }
        }
        else {
            descr = a+" = "+attrs.get(a);
        }
        if ( !names.add(a) ) {
            StringBuilder builder = new StringBuilder();
            builder.append("<html><font color=\"gray\">");
            builder.append(StringRenderer.escapeHTML(descr));
            builder.append("</font></html>");
            descr = builder.toString();
        }
        node.addChild(new StringTree(descr));
    }
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:37,代码来源:JTreeScopeStackModel.java

示例4: addAttributeDescriptions

import org.stringtemplate.v4.ST; //导入方法依赖的package包/类
public void addAttributeDescriptions(ST st, StringTree node, Set<String> names) {
	Map<String, Object> attrs = st.getAttributes();
	if ( attrs==null ) return;
	for (String a : attrs.keySet()) {
		String descr;
		if ( st.debugState!=null && st.debugState.addAttrEvents!=null ) {
			List<AddAttributeEvent> events = st.debugState.addAttrEvents.get(a);
			StringBuilder locations = new StringBuilder();
			int i = 0;
			if ( events!=null ) {
				for (AddAttributeEvent ae : events) {
					if ( i>0 ) locations.append(", ");
					locations.append(ae.getFileName()+":"+ae.getLine());
					i++;
				}
			}
			if ( locations.length()>0 ) {
				descr = a+" = "+attrs.get(a)+" @ "+locations.toString();
			}
			else {
				descr = a + " = " +attrs.get(a);
			}
		}
		else {
			descr = a + " = " +attrs.get(a);
		}

		if (!names.add(a)) {
			StringBuilder builder = new StringBuilder();
			builder.append("<html><font color=\"gray\">");
			builder.append(StringRenderer.escapeHTML(descr));
			builder.append("</font></html>");
			descr = builder.toString();
		}

		node.addChild( new StringTree(descr) );
	}
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:39,代码来源:JTreeScopeStackModel.java


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