org.apache.karaf.shell.support.table.Row类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.apache.karaf.shell.support.table.Row类的一些代码示例,展示了Row类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row类的具体详情如下:
包路径:org.apache.karaf.shell.support.table.Row
类名称:Row

Row介绍

暂无

代码示例

代码示例来源:origin: apache/karaf

/**
 * Adds information used by proxy/server
 * @param row {@link org.apache.karaf.shell.support.table.ShellTable}'s row to add information to
 * @param id2Password mapping of ids (servers/proxies to decrypted passwords)
 * @param id ID of proxy or server from <code>settings.xml</code>
 * @param password password to use if decryption failed
 */
protected void addPasswordInfo(Row row, Map<String, String> id2Password, String id, String password) {
  if (id2Password.containsKey(id)) {
    row.addContent(id2Password.get(id));
  } else {
    if (cipher.isEncryptedString(password)) {
      row.addContent(password + " (can't decrypt)");
    } else {
      row.addContent(password == null ? "" : password);
    }
  }
}

代码示例来源:origin: stackoverflow.com

var Row = function () {
  this.a = 1;
}

var myRow = new Row();
myRow.a // this will give you your 'a'

代码示例来源:origin: stackoverflow.com

private static Triangle generateTriangle() 
{
      Triangle triangle = new Triangle();

    Random random = new Random();

    for (int i = 0; i < TRIANGLE_HEIGHT; i++) {

      Row row = new Row();
      int maxTemp=0;
      for (int j = 0; j <= i; j++) {
        int rand=random.nextInt(100);
        row.add(rand);
        if(rand>maxTemp)
          maxTemp=rand;     //will get max value for the row
      }
      maxRowVal.add(maxTemp);
      triangle.add(row);
    }
    return triangle;
  }

代码示例来源:origin: stackoverflow.com

List<Row> myRowArray = new ArrayList<Row>;

Row result;
      for (int i = 0; i < array.length(); i++) {
        result = new Row();
        result.setThumb( fromJson ); //Set thumb string you got from json
        result.setAuthor( fromJson ); //Set Author string you got from json
         .....
         myRowArray.add(result);
      }

代码示例来源:origin: stackoverflow.com

List<Row> rows = new ArrayList<Row>();
for (all your parsed string data)
{
  Row row = new Row();
  row.setText("your parsed text");
  row.setDate("your parsed date");
  rows.add(row); 
}

代码示例来源:origin: stackoverflow.com

public int doStartTag() throws JspException {
// some code here
ArrayList<Row> rowList = new ArrayList<>();
 while(set.next()){
   //pageContext.getOut().print("<br>" + set.getString("empName"));
    Row currRow = new Row();
    currRow.setValue(set.getString("empName"));
    rowList.add(currRow);
 }
 pageContext.setAttribute("result", rowList);
 // some more code 
}

代码示例来源:origin: stackoverflow.com

List<Row> list = new ArrayList<>();
try {
  JSONObject json = new JSONObject(result);
  JSONArray jArray = json.getJSONArray("DATA");
  for (int i = 0; i < jArray.length(); i++) {
    JSONObject json_data = jArray.getJSONObject(i);
    Row data = new Row(); // Create Object Here
    data.setRow(json_data.getInt("Row"));

    JSONArray arr = json_data.getJSONArray("Data");
    for(int j = 0; j < arr.length(); j++) {
      JSONObject innerData = arr.getJSONObject(j);
      DataObj dataObj = new DataObj(); // Create Object here
      dataObj.setShowTitle(innerData.getString("ShowTitle"));
      data.setDataObj(dataObj); // setting the dataObj

      //Add the DataObj to a list in the Row object
      data.addDataObject(dataObj);
    }

    list.add(data); // Finally adding the model to List
  }
} catch (JSONException e) {
  e.printStackTrace();
}

代码示例来源:origin: stackoverflow.com

List<Row> list = new ArrayList<>();
 try {

  JSONObject json = new JSONObject(result);
  JSONArray jArray = json.getJSONArray("DATA");
  for (int i = 0; i < jArray.length(); i++) {

    JSONObject json_data = jArray.getJSONObject(i);

    JSONArray arr = json_data.getJSONArray("Data");
    for(int j = 0; j < arr.length(); j++) {
      Row data = new Row(); // Create Object Here
      data.setRow(json_data.getInt("Row"));
      JSONObject innerData = arr.getJSONObject(j);
      DataObj dataObj = new DataObj(); // Create Object here
      dataObj.setShowTitle(innerData.getString("ShowTitle"));
      data.setDataObj(dataObj); // setting the dataObj
      list.add(data);
    }

     // Finally adding the model to List
  }
} catch (JSONException e) {
  e.printStackTrace();
}

代码示例来源:origin: apache/karaf

Row headerRow = new Row(cols);
headerRow.formatContent(cols);
for (Row row : rows) {
  row.formatContent(cols);
  String headerLine = headerRow.getContent(cols, separator);
  out.println(headerLine);
  int iCol = 0;
  if (!format) {
    if (separator == null || separator.equals(DEFAULT_SEPARATOR))
      out.println(row.getContent(cols, DEFAULT_SEPARATOR_NO_FORMAT));
    else out.println(row.getContent(cols, separator));
  } else {
    out.println(row.getContent(cols, separator));

代码示例来源:origin: stackoverflow.com

final List<Row> rows = new ArrayList<>();

addTableField.setOnAction(new EventHandler<ActionEvent>() {
  @Override
  public void handle(ActionEvent event) {             
    HBox box = new HBox(10);

    ComboBox<String> combo = new ComboBox<String>(fieldTypes);
    combo.setPromptText("type");

    TextField field = new TextField();
    field.setPromptText("field label");

    box.getChildren().addAll(field, combo);

    fieldContainer.getChildren().addAll(box);

    Row row = new Row();
    rows.add(row);
    row.labelProperty().bind(field.textProperty());
    row.typeProperty().bind(combo.valueProperty()); // might need to worry about null values...

    window.sizeToScene();
  }
});

代码示例来源:origin: stackoverflow.com

Row r1 = new Row();
r1.getAny().put( new QName( "Column1" ), "table1" );

代码示例来源:origin: stackoverflow.com

public List<Row> list() throws SQLException {
  Connection connection = null;
  Statement statement = null;
  ResultSet resultSet = null;
  List<Row> rows = new ArrayList<Row>();

  try {
    connection = database.getConnection();
    statement = connection.createStatement();
    resultSet = statement.executeQuery(SQL_LIST);
    while (resultSet.next()) {
      Row row = new Row();
      row.setName(resultSet.getString("name"));
      // ...
      rows.add(row);
    }
  } finally {
    if (resultSet != null) try { resultSet.close(); } catch (SQLException logOrIgnore) {}
    if (statement != null) try { statement.close(); } catch (SQLException logOrIgnore) {}
    if (connection != null) try { connection.close(); } catch (SQLException logOrIgnore) {}
  }

  return rows;
}

代码示例来源:origin: stackoverflow.com

for (String str : listOne) {
  List<Object> cList = new ArrayList<>();
  Row row = new Row();
  for (Object obj : listTwo) {
    C c = new C();
    c.setV(obj.getAttribute());
    c.setF(null);
    cList.add(c);
    row.setC(cList);
    rows.add(row);
  }
}

代码示例来源:origin: apache/karaf

/**
 * Helper to add row to {@link ShellTable}
 * @param table
 * @param label
 * @param value
 * @param descriptionText
 */
private <T> void addRow(ShellTable table, String label, SourceAnd<T> value, String descriptionText) {
  Row row = table.addRow();
  row.addContent(label, value.val());
  if (source) {
    row.addContent(value.source);
  }
  if (description) {
    row.addContent(descriptionText);
  }
}

代码示例来源:origin: stackoverflow.com

abstract public class Table<RowClass extends Row>{
  public List<RowClass> fetchAll() {
    //Fetch the stuff here
    //In the while class to add each row to the array
    RowClass row = (RowClass) new Row();
  }
}

代码示例来源:origin: apache/karaf

private List<String> displayGroupRoles(BackingEngine engine, String userName, GroupPrincipal group, ShellTable table) {
  List<String> names = new ArrayList<>();
  List<RolePrincipal> roles = engine.listRoles(group);
  if (roles != null && roles.size() >= 1) {
    for (RolePrincipal role : roles) {
      String roleName = role.getName();
      names.add(roleName);
      table.addRow().addContent(userName, group.getName(), roleName);
    }
  }
  return names;
}

代码示例来源:origin: stackoverflow.com

while (result.next()) {    
   Row row = new Row();
   row.internalCode = (((result_data = result.getObject("internal_code"))==null || result.wasNull())?" ":result_data.toString());
   row.externalRepresentation = (((result_data = result.getObject("external_representation"))==null || result.wasNull())?" ":result_data.toString());
   row.sorter = (((result_data = result.getObject("sorter"))==null || result.wasNull())?" ":result_data.toString());
   row.sDate = (((result_data = result.getObject("sDate"))==null || result.wasNull())?" ":result_data.toString());      
}

代码示例来源:origin: org.apache.karaf.jaas/org.apache.karaf.jaas.command

private List<String> displayGroupRoles(BackingEngine engine, String userName, GroupPrincipal group, ShellTable table) {
  List<String> names = new ArrayList<>();
  List<RolePrincipal> roles = engine.listRoles(group);
  if (roles != null && roles.size() >= 1) {
    for (RolePrincipal role : roles) {
      String roleName = role.getName();
      names.add(roleName);
      table.addRow().addContent(userName, group.getName(), roleName);
    }
  }
  return names;
}

代码示例来源:origin: stackoverflow.com

while ((line = br.readLine()) != null) {
     String[] row = line.split("\\s+");
     Row row = new Row();
     row.setId(row[0]);
     row.setFirstName(row[1]);
     row.setSecondName(row[2]);
     row.setDateOfbrth(row[3]);
     InfoList.add(row);
   }

代码示例来源:origin: apache/karaf

@Override
public Object execute() throws Exception {
  ShellTable table = new ShellTable();
  Map<String, List<String>> map = this.getJdbcService().tables(datasource);
  int rowCount = 0;
  for (String column : map.keySet()) {
    table.column(column);
    rowCount = map.get(column).size();
  }
  for (int i = 0; i < rowCount; i++) {
    Row row = table.addRow();
    for (String column : map.keySet()) {
      row.addContent(map.get(column).get(i));
    }
  }
  table.print(System.out);
  return null;
}

相关文章