當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。