本文整理汇总了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));
}
}
示例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));
}
}
示例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));
}
}
示例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) );
}
}