Package org.jboss.as.cli.util

Examples of org.jboss.as.cli.util.SimpleTable.addLine()


                        final ModelNodeFormatter formatter = ModelNodeFormatter.Factory.forType(valueResult.getType());
                        formatter.format(valueBuf, 0, valueResult);
                    } else {
                        valueBuf.append("n/a");
                    }
                    table.addLine(new String[]{"value", valueBuf.toString()});
                } else {
                    ctx.printLine("Failed to get resource description: " + response);
                }
            }
View Full Code Here


                            if(name == null) {
                                ctx.printLine("Attribute name is not available in handleResponse.");
                            } else if(attributes.hasDefined(name)) {
                                final ModelNode descr = attributes.get(name);
                                for(String prop : descr.keys()) {
                                    table.addLine(new String[]{prop, descr.get(prop).asString()});
                                }
                            } else {
                                ctx.printLine("Attribute description is not available.");
                            }
                        } else {
View Full Code Here

                                                }
                                            } else if(childDescriptions != null) {
                                                if(childDescriptions.hasDefined(prop.getName())) {
                                                    final ModelNode childDescr = childDescriptions.get(prop.getName());
                                                    final Integer maxOccurs = getAsInteger(childDescr, Util.MAX_OCCURS);
                                                    childrenTable.addLine(new String[]{prop.getName(),
                                                            getAsString(childDescr, Util.MIN_OCCURS),
                                                            maxOccurs == null ? "n/a" : (maxOccurs == Integer.MAX_VALUE ? "unbounded" : maxOccurs.toString())
                                                            });
                                                } else {
                                                    childrenTable.addLine(new String[]{prop.getName(), "n/a", "n/a"});
View Full Code Here

                                                    childrenTable.addLine(new String[]{prop.getName(),
                                                            getAsString(childDescr, Util.MIN_OCCURS),
                                                            maxOccurs == null ? "n/a" : (maxOccurs == Integer.MAX_VALUE ? "unbounded" : maxOccurs.toString())
                                                            });
                                                } else {
                                                    childrenTable.addLine(new String[]{prop.getName(), "n/a", "n/a"});
                                                }
                                            }
                                        }

                                        StringBuilder buf = null;
View Full Code Here

    public static void main(String[] args) throws Exception {

        //System.out.printf("%-8s %-11s %-8s %-11s", "name", "type", "required", "access-type");
        SimpleTable t = new SimpleTable(new String[]{"NAME", "TYPE", "REQUIRED", "ACCESS-TYPE", "VALUE"});
        t.addLine(new String[]{"name1", "big_integer", "true", "read-write", "12"});
        t.addLine(new String[]{"some name", "int", "false", "read-only", null});
        System.out.println(t.toString());
    }
}
View Full Code Here

    public static void main(String[] args) throws Exception {

        //System.out.printf("%-8s %-11s %-8s %-11s", "name", "type", "required", "access-type");
        SimpleTable t = new SimpleTable(new String[]{"NAME", "TYPE", "REQUIRED", "ACCESS-TYPE", "VALUE"});
        t.addLine(new String[]{"name1", "big_integer", "true", "read-write", "12"});
        t.addLine(new String[]{"some name", "int", "false", "read-only", null});
        System.out.println(t.toString());
    }
}
View Full Code Here

                    }
                    source = buf.toString();
                } else {
                    source = "n/a";
                }
                table.addLine(new String[] { driverName.asString(), source });
            }
            ctx.printLine(table.toString(true));
        } else {
            final String name = this.name.getValue(ctx.getParsedCommandLine());
            final SimpleTable table = new SimpleTable(2);
View Full Code Here

                    throw new CommandLineException(Util.DRIVER_NAME + " is not available: " + node);
                }
                if(name.equals(driverName.asString())) {
                    for(String propName : node.keys()) {
                        final ModelNode value = node.get(propName);
                        table.addLine(new String[] { propName, value.isDefined() ? value.asString() : "n/a" });
                    }
                }
            }
            ctx.printLine(table.toString(false));
        }
View Full Code Here

                                        }
                                    } else if (childDescriptions != null) {
                                        if (childDescriptions.hasDefined(prop.getName())) {
                                            final ModelNode childDescr = childDescriptions.get(prop.getName());
                                            final Integer maxOccurs = getAsInteger(childDescr, Util.MAX_OCCURS);
                                            childrenTable.addLine(new String[] {prop.getName(), getAsString(childDescr, Util.MIN_OCCURS), maxOccurs == null ? "n/a"
                                                                    : (maxOccurs == Integer.MAX_VALUE ? "unbounded" : maxOccurs.toString()) });
                                        } else {
                                            childrenTable.addLine(new String[] {prop.getName(), "n/a", "n/a" });
                                        }
                                    }
View Full Code Here

                                            final ModelNode childDescr = childDescriptions.get(prop.getName());
                                            final Integer maxOccurs = getAsInteger(childDescr, Util.MAX_OCCURS);
                                            childrenTable.addLine(new String[] {prop.getName(), getAsString(childDescr, Util.MIN_OCCURS), maxOccurs == null ? "n/a"
                                                                    : (maxOccurs == Integer.MAX_VALUE ? "unbounded" : maxOccurs.toString()) });
                                        } else {
                                            childrenTable.addLine(new String[] {prop.getName(), "n/a", "n/a" });
                                        }
                                    }
                                }

                                StringBuilder buf = null;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.