Fixed javadoc warnings
This commit is contained in:
parent
2276a55722
commit
e0881247c4
5 changed files with 40 additions and 20 deletions
|
|
@ -128,9 +128,10 @@ public abstract class DBBean {
|
||||||
* Saves the bean and all its sub beans to the DB
|
* Saves the bean and all its sub beans to the DB
|
||||||
*
|
*
|
||||||
* @param db is the DBMS connection
|
* @param db is the DBMS connection
|
||||||
|
* @throws SQLException if there is any issue with the SQL query
|
||||||
*/
|
*/
|
||||||
public void save(DBConnection db) throws SQLException{
|
public void save(DBConnection db) throws SQLException{
|
||||||
save( db, true );
|
save(db, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -138,6 +139,7 @@ public abstract class DBBean {
|
||||||
*
|
*
|
||||||
* @param db the DBMS connection
|
* @param db the DBMS connection
|
||||||
* @param recursive if all sub beans should be saved also
|
* @param recursive if all sub beans should be saved also
|
||||||
|
* @throws SQLException if there is any issue with the SQL query
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void save(DBConnection db, boolean recursive) throws SQLException{
|
public void save(DBConnection db, boolean recursive) throws SQLException{
|
||||||
|
|
@ -274,6 +276,9 @@ public abstract class DBBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the bean from the DB and all its sub beans and links.
|
* Deletes the bean from the DB and all its sub beans and links.
|
||||||
|
*
|
||||||
|
* @param db the DBMS connection
|
||||||
|
* @throws SQLException if there is any issue with the SQL query
|
||||||
*/
|
*/
|
||||||
public void delete(DBConnection db) throws SQLException{
|
public void delete(DBConnection db) throws SQLException{
|
||||||
delete(db, true);
|
delete(db, true);
|
||||||
|
|
@ -281,7 +286,9 @@ public abstract class DBBean {
|
||||||
/**
|
/**
|
||||||
* Deletes the bean from the DB and the links to sub beans.
|
* Deletes the bean from the DB and the links to sub beans.
|
||||||
*
|
*
|
||||||
|
* @param db the DBMS connection
|
||||||
* @param recursive if all sub beans should be deleted also
|
* @param recursive if all sub beans should be deleted also
|
||||||
|
* @throws SQLException if there is any issue with the SQL query
|
||||||
*/
|
*/
|
||||||
public void delete(DBConnection db, boolean recursive) throws SQLException{
|
public void delete(DBConnection db, boolean recursive) throws SQLException{
|
||||||
Class<? extends DBBean> c = this.getClass();
|
Class<? extends DBBean> c = this.getClass();
|
||||||
|
|
@ -324,9 +331,11 @@ public abstract class DBBean {
|
||||||
/**
|
/**
|
||||||
* Loads all rows from the table into a LinkedList
|
* Loads all rows from the table into a LinkedList
|
||||||
*
|
*
|
||||||
* @param <T> is the class of the bean
|
* @param <T> is the class of the bean
|
||||||
* @param c is the class of the bean
|
* @param db the DBMS connection
|
||||||
* @return a LinkedList with all the beans in the DB
|
* @param c is the class of the bean
|
||||||
|
* @return a LinkedList with all the beans in the DB
|
||||||
|
* @throws SQLException if there is any issue with the SQL query
|
||||||
*/
|
*/
|
||||||
public static <T extends DBBean> List<T> load(DBConnection db, Class<T> c) throws SQLException {
|
public static <T extends DBBean> List<T> load(DBConnection db, Class<T> c) throws SQLException {
|
||||||
// Initiate a BeanConfig if there is non
|
// Initiate a BeanConfig if there is non
|
||||||
|
|
@ -343,9 +352,11 @@ public abstract class DBBean {
|
||||||
* Loads a specific instance of the bean from the table with the specific id
|
* Loads a specific instance of the bean from the table with the specific id
|
||||||
*
|
*
|
||||||
* @param <T> is the class of the bean
|
* @param <T> is the class of the bean
|
||||||
|
* @param db the DBMS connection
|
||||||
* @param c is the class of the bean
|
* @param c is the class of the bean
|
||||||
* @param id is the id value of the bean
|
* @param id is the id value of the bean
|
||||||
* @return a DBBean Object with the specific id or null if the id was not found
|
* @return a DBBean Object with the specific id or null if the id was not found
|
||||||
|
* @throws SQLException if there is any issue with the SQL query
|
||||||
*/
|
*/
|
||||||
public static <T extends DBBean> T load(DBConnection db, Class<T> c, long id) throws SQLException {
|
public static <T extends DBBean> T load(DBConnection db, Class<T> c, long id) throws SQLException {
|
||||||
// Initiate a BeanConfig if there is non
|
// Initiate a BeanConfig if there is non
|
||||||
|
|
@ -363,9 +374,13 @@ public abstract class DBBean {
|
||||||
/**
|
/**
|
||||||
* Creates a specific table for the given Bean,
|
* Creates a specific table for the given Bean,
|
||||||
* WARNING: Experimental
|
* WARNING: Experimental
|
||||||
|
*
|
||||||
|
* @param db the DBMS connection
|
||||||
|
* @param c is the class of the bean
|
||||||
|
* @throws SQLException if there is any issue with the SQL query
|
||||||
*/
|
*/
|
||||||
public static void create(DBConnection sql, Class<? extends DBBean> c) throws SQLException{
|
public static void create(DBConnection db, Class<? extends DBBean> c) throws SQLException{
|
||||||
DBBeanConfig config = DBBeanConfig.getBeanConfig( c );
|
DBBeanConfig config = DBBeanConfig.getBeanConfig(c);
|
||||||
|
|
||||||
// Generate the SQL
|
// Generate the SQL
|
||||||
StringBuilder query = new StringBuilder();
|
StringBuilder query = new StringBuilder();
|
||||||
|
|
@ -373,7 +388,7 @@ public abstract class DBBean {
|
||||||
|
|
||||||
// ID
|
// ID
|
||||||
query.append(" ").append(config.getIdColumnName()).append(" ");
|
query.append(" ").append(config.getIdColumnName()).append(" ");
|
||||||
query.append( classToDBType( Long.class ) );
|
query.append(classToDBType(Long.class));
|
||||||
query.append(" PRIMARY KEY AUTO_INCREMENT, ");
|
query.append(" PRIMARY KEY AUTO_INCREMENT, ");
|
||||||
|
|
||||||
for( DBBeanFieldConfig field : config.getFields() ){
|
for( DBBeanFieldConfig field : config.getFields() ){
|
||||||
|
|
@ -385,8 +400,8 @@ public abstract class DBBean {
|
||||||
query.delete(query.length()-2, query.length());
|
query.delete(query.length()-2, query.length());
|
||||||
query.append(")");
|
query.append(")");
|
||||||
|
|
||||||
logger.finest("Create Bean("+c.getName()+") query: "+sql.toString());
|
logger.finest("Create Bean("+c.getName()+") query: " + db.toString());
|
||||||
PreparedStatement stmt = sql.getPreparedStatement( sql.toString() );
|
PreparedStatement stmt = db.getPreparedStatement(db.toString());
|
||||||
|
|
||||||
// Execute the SQL
|
// Execute the SQL
|
||||||
DBConnection.exec(stmt);
|
DBConnection.exec(stmt);
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,8 @@ public class FileSearcher implements Iterable<FileSearcher.FileSearchItem>{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the file extensions to search for (should not include . at the beginning)
|
* Sets the file extensions to search for (should not include . at the beginning)
|
||||||
|
*
|
||||||
|
* @param ext is a String containing the file extension
|
||||||
*/
|
*/
|
||||||
public void setExtension(String ext){
|
public void setExtension(String ext){
|
||||||
extension = ext;
|
extension = ext;
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ public class MulticastDnsServer extends ThreadedUDPNetwork implements ThreadedUD
|
||||||
* @param name is the domain name to add the entry under
|
* @param name is the domain name to add the entry under
|
||||||
* @param type {@link zutil.net.dns.packet.DnsConstants.TYPE}
|
* @param type {@link zutil.net.dns.packet.DnsConstants.TYPE}
|
||||||
* @param clazz {@link zutil.net.dns.packet.DnsConstants.CLASS}
|
* @param clazz {@link zutil.net.dns.packet.DnsConstants.CLASS}
|
||||||
|
* @param data is the payload to include in client response
|
||||||
*/
|
*/
|
||||||
public void addEntry(String name, int type, int clazz, byte[] data){
|
public void addEntry(String name, int type, int clazz, byte[] data){
|
||||||
DnsPacketResource resource = new DnsPacketResource();
|
DnsPacketResource resource = new DnsPacketResource();
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ public class ThreadedUDPNetwork extends Thread{
|
||||||
*
|
*
|
||||||
* @param port is the port that the server should listen to
|
* @param port is the port that the server should listen to
|
||||||
* @param multicastAddr is the multicast address that the server will listen on
|
* @param multicastAddr is the multicast address that the server will listen on
|
||||||
|
* @throws IOException if there is any issue opening the connection
|
||||||
*/
|
*/
|
||||||
public ThreadedUDPNetwork(String multicastAddr, int port ) throws IOException{
|
public ThreadedUDPNetwork(String multicastAddr, int port ) throws IOException{
|
||||||
this.type = UDPType.MULTICAST;
|
this.type = UDPType.MULTICAST;
|
||||||
|
|
@ -109,8 +110,9 @@ public class ThreadedUDPNetwork extends Thread{
|
||||||
* Sends the given packet
|
* Sends the given packet
|
||||||
*
|
*
|
||||||
* @param packet is the packet to send
|
* @param packet is the packet to send
|
||||||
|
* @throws IOException if there is any issue with sending the packet
|
||||||
*/
|
*/
|
||||||
public synchronized void send( DatagramPacket packet ) throws IOException{
|
public synchronized void send(DatagramPacket packet) throws IOException {
|
||||||
socket.send(packet);
|
socket.send(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -119,7 +121,7 @@ public class ThreadedUDPNetwork extends Thread{
|
||||||
*
|
*
|
||||||
* @param thread is the thread
|
* @param thread is the thread
|
||||||
*/
|
*/
|
||||||
public void setThread(ThreadedUDPNetworkThread thread){
|
public void setThread(ThreadedUDPNetworkThread thread) {
|
||||||
this.thread = thread;
|
this.thread = thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ public interface BinaryStruct {
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@interface BinaryField{
|
@interface BinaryField{
|
||||||
/** Will be used to order the fields are read. Lowest index number field will be read first. */
|
/** @return a number indicating the order the fields are read. Lowest index number field will be read first. */
|
||||||
int index();
|
int index();
|
||||||
/** Defines the bit length of the data */
|
/** @return the bit length of the data */
|
||||||
int length();
|
int length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,12 +57,12 @@ public interface BinaryStruct {
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@interface VariableLengthBinaryField{
|
@interface VariableLengthBinaryField{
|
||||||
/** Will be used to order the fields are read. Lowest index number field will be read first. */
|
/** @return a number indicating the order the fields are read. Lowest index number field will be read first. */
|
||||||
int index();
|
int index();
|
||||||
/** The name of the field that will contain the length of the data to read. */
|
/** @return a String name of the field that contains the length of the data to be read. */
|
||||||
String lengthField();
|
String lengthField();
|
||||||
/** Defines the multiplier used on the lengthField parameter to convert the length in bits to
|
/** @return the multiplier used on the lengthField parameter to convert the length in bits to
|
||||||
* a user defined value. Default value is 8 (which converts length to nr of bytes). */
|
* a user defined value. Default value is 8 (which converts length to number of bytes). */
|
||||||
int multiplier() default 8;
|
int multiplier() default 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,9 +72,9 @@ public interface BinaryStruct {
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@interface CustomBinaryField{
|
@interface CustomBinaryField{
|
||||||
/** Will be used to order the fields are read. Lowest index number field will be read first. */
|
/** @return a number indicating the order the fields are read. Lowest index number field will be read first. */
|
||||||
int index();
|
int index();
|
||||||
/** Defines the serializer class that will be used. Class needs to be publicly visible. */
|
/** @return the serializer class name that will be used. Class needs to be publicly visible. */
|
||||||
Class<? extends BinaryFieldSerializer> serializer();
|
Class<? extends BinaryFieldSerializer> serializer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue