/** * Reset the title settings * * @param player Player */ public static void resetTitle(Player player) { try { // Send timings first Object handle = ReflectionUtils.getHandle(player); Object connection = ReflectionUtils.getField(handle.getClass(), "playerConnection").get(handle); Object[] actions = packetActions.getEnumConstants(); Method sendPacket = ReflectionUtils.getMethod(connection.getClass(), "sendPacket"); Object packet = packetTitle .getConstructor(packetActions, chatBaseComponent) .newInstance(actions[4], null); sendPacket.invoke(connection, packet); } catch (Exception e) { e.printStackTrace(); } }
public SqlMapRepositoryFactory(SqlMapClient sqlMapClient) { Assert.notNull(sqlMapClient, "SqlMapClient must not be null!"); this.sqlMapClient = (SqlMapClientImpl) sqlMapClient; this.sqlMapClientTemplate = new SqlMapClientTemplate(sqlMapClient); if (ExtendedSqlMapClient.class.isAssignableFrom(sqlMapClient.getClass())) { this.sqlMapExecutorDelegate = ((ExtendedSqlMapClient) sqlMapClient).getDelegate(); } else if (hasSqlMapExecutorDelegate(sqlMapClient)) { Field field = findSqlMapExecutorDelegate(sqlMapClient); field.setAccessible(true); this.sqlMapExecutorDelegate = (SqlMapExecutorDelegate) ReflectionUtils.getField(field, sqlMapClient); } else { throw new IllegalArgumentException("not found SqlMapExecutorDelegate in SqlMapClient."); } }
private static Field getAstNodeField(String name) { return ReflectionUtils.getField(AstNode.class, name); }
protected static Object doGetVisitorAttribute() { return ReflectionUtils.getField(VISITOR_ATTRIBUTES_FIELD_RECURSE, null); }