Java Code Examples for java.beans.Statement

The following examples show how to use java.beans.Statement. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: openjdk-jdk9   Source File: ClassForName.java    License: GNU General Public License v2.0 6 votes vote down vote up
private static void simpleTest() throws Exception {
    // load the class without initialization
    new Statement(Class.class, "forName", new Object[]{
            "ClassForName$Bean", false, Bean.class.getClassLoader()
    }).execute();
    if (initialized) {
        throw new RuntimeException("Should not be initialized");
    }

    // load the class and initialize it
    new Statement(Class.class, "forName", new Object[]{
            "ClassForName$Bean", true, Bean.class.getClassLoader()
    }).execute();
    if (!initialized) {
        throw new RuntimeException("Should be initialized");
    }
}
 
Example 2
Source Project: dragonwell8_jdk   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 3
Source Project: dragonwell8_jdk   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 4
Source Project: TencentKona-8   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 5
Source Project: TencentKona-8   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 6
Source Project: jdk8u60   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 7
Source Project: jdk8u60   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 8
Source Project: openjdk-jdk8u   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 9
Source Project: openjdk-jdk8u   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 10
Source Project: java-swing-tips   Source File: MainPanel.java    License: MIT License 5 votes vote down vote up
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
@Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder encoder) {
  super.initialize(type, oldInstance, newInstance, encoder);
  DefaultTableModel m = (DefaultTableModel) oldInstance;
  for (int row = 0; row < m.getRowCount(); row++) {
    for (int col = 0; col < m.getColumnCount(); col++) {
      Object[] o = {m.getValueAt(row, col), row, col};
      encoder.writeStatement(new Statement(oldInstance, "setValueAt", o));
    }
  }
}
 
Example 11
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 12
Source Project: java-swing-tips   Source File: MainPanel.java    License: MIT License 5 votes vote down vote up
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
@Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder encoder) {
  super.initialize(type, oldInstance, newInstance, encoder);
  DefaultTableModel m = (DefaultTableModel) oldInstance;
  for (int row = 0; row < m.getRowCount(); row++) {
    for (int col = 0; col < m.getColumnCount(); col++) {
      Object[] o = {m.getValueAt(row, col), row, col};
      encoder.writeStatement(new Statement(oldInstance, "setValueAt", o));
    }
  }
}
 
Example 13
Source Project: openjdk-jdk9   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 14
Source Project: openjdk-jdk9   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 15
Source Project: jdk8u-jdk   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 16
Source Project: jdk8u-jdk   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 17
Source Project: java-swing-tips   Source File: MainPanel.java    License: MIT License 5 votes vote down vote up
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
@Override protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder encoder) {
  super.initialize(type, oldInstance, newInstance, encoder);
  DefaultTableModel m = (DefaultTableModel) oldInstance;
  // Vector v = m.getDataVector();
  // for (int i = 0; i < m.getRowCount(); i++) {
  //   encoder.writeStatement(new Statement(oldInstance, "addRow", new Object[] { (Vector) v.get(i) }));
  // }
  for (int row = 0; row < m.getRowCount(); row++) {
    for (int col = 0; col < m.getColumnCount(); col++) {
      Object[] o = {m.getValueAt(row, col), row, col};
      encoder.writeStatement(new Statement(oldInstance, "setValueAt", o));
    }
  }
}
 
Example 18
Source Project: hottub   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 19
Source Project: hottub   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 20
Source Project: openjdk-8-source   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 21
Source Project: openjdk-8-source   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 22
Source Project: gridgo   Source File: ObjectUtils.java    License: MIT License 5 votes vote down vote up
public static void setValue(Object config, String attr, Object value) {
    var setter = "set" + StringUtils.upperCaseFirstLetter(attr);
    var stmt = new Statement(config, setter, new Object[] { value });
    try {
        stmt.execute();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
Example 23
Source Project: openjdk-8   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 24
Source Project: openjdk-8   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 25
Source Project: jdk8u_jdk   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 26
Source Project: jdk8u_jdk   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 27
Source Project: jdk8u-jdk   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 28
Source Project: jdk8u-jdk   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}
 
Example 29
Source Project: jdk8u-dev-jdk   Source File: Test8013416.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
Example 30
Source Project: jdk8u-dev-jdk   Source File: Test8005065.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static void testStatement() {
    Object[] array = { new Object() };
    Statement statement = new Statement(null, null, array);
    test(statement.getArguments());
    array[0] = null;
    test(statement.getArguments());
    statement.getArguments()[0] = null;
    test(statement.getArguments());
}