From: Roland Haeder Date: Wed, 12 Aug 2015 11:21:53 +0000 (+0200) Subject: Added some thrown exceptions X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0c3347f86cd4f804b1305d330ed2855bb5d7a02e;p=jcore.git Added some thrown exceptions Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/jcore/BaseFrameworkSystem.java b/src/org/mxchange/jcore/BaseFrameworkSystem.java index a6e06a2..6d7ca8a 100644 --- a/src/org/mxchange/jcore/BaseFrameworkSystem.java +++ b/src/org/mxchange/jcore/BaseFrameworkSystem.java @@ -179,9 +179,11 @@ public class BaseFrameworkSystem implements FrameworkInterface { * @return Value from field * @throws IllegalArgumentException Some implementations may throw this. * @throws NoSuchMethodException Some implementations may throw this. + * @throws java.lang.IllegalAccessException If the method cannot be accessed + * @throws java.lang.reflect.InvocationTargetException Any other problems? */ @Override - public Object getValueFromColumn (final String columnName) throws IllegalArgumentException, NoSuchMethodException { + public Object getValueFromColumn (final String columnName) throws IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { throw new UnsupportedOperationException(MessageFormat.format("Not implemented. columnName={0}", columnName)); //NOI18N } @@ -321,9 +323,11 @@ public class BaseFrameworkSystem implements FrameworkInterface { * @param bool Boolean value * @return Whether all conditions are met * @throws NoSuchMethodException May be thrown by some implementations + * @throws java.lang.IllegalAccessException If the method cannot be accessed + * @throws java.lang.reflect.InvocationTargetException Any other problems? */ @Override - public boolean isValueEqual (final String columnName, final boolean bool) throws NoSuchMethodException { + public boolean isValueEqual (final String columnName, final boolean bool) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Not implemented throw new UnsupportedOperationException(MessageFormat.format("Not implemented. columnName={0},bool={1}", columnName, bool)); //NOI18N } @@ -623,8 +627,10 @@ public class BaseFrameworkSystem implements FrameworkInterface { * @param className Class name to iterate over * @return An iterator over all object's fields * @throws java.lang.NoSuchMethodException If the called method does not exist + * @throws java.lang.IllegalAccessException If the method cannot be accessed + * @throws java.lang.reflect.InvocationTargetException Any other problems? */ - protected Iterator> fieldIterator (final FrameworkInterface instance, final String className) throws IllegalArgumentException, NoSuchMethodException { + protected Iterator> fieldIterator (final FrameworkInterface instance, final String className) throws IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace(MessageFormat.format("instance={0},className={1} - CALLED!", instance, className)); //NOI18N diff --git a/src/org/mxchange/jcore/FrameworkInterface.java b/src/org/mxchange/jcore/FrameworkInterface.java index 8ebc003..0e44d7e 100644 --- a/src/org/mxchange/jcore/FrameworkInterface.java +++ b/src/org/mxchange/jcore/FrameworkInterface.java @@ -16,6 +16,7 @@ */ package org.mxchange.jcore; +import java.lang.reflect.InvocationTargetException; import org.apache.logging.log4j.Logger; import org.mxchange.jcore.application.Application; import org.mxchange.jcore.client.Client; @@ -87,8 +88,10 @@ public interface FrameworkInterface { * @param bool Boolean value * @return Whether all conditions are met * @throws java.lang.NoSuchMethodException If called method was not found + * @throws java.lang.IllegalAccessException If the method cannot be accessed + * @throws java.lang.reflect.InvocationTargetException Any other problems? */ - public boolean isValueEqual (final String columnName, final boolean bool) throws NoSuchMethodException; + public boolean isValueEqual (final String columnName, final boolean bool) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Some "getter for a value from given column name. This name will be @@ -98,6 +101,8 @@ public interface FrameworkInterface { * @return Value from field * @throws IllegalArgumentException Some implementations may throw this * @throws java.lang.NoSuchMethodException If the invoked method was not found + * @throws java.lang.IllegalAccessException If the method cannot be accessed + * @throws java.lang.reflect.InvocationTargetException Any other problems? */ - public Object getValueFromColumn (final String columnName) throws IllegalArgumentException, NoSuchMethodException; + public Object getValueFromColumn (final String columnName) throws IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException; } diff --git a/src/org/mxchange/jcore/contact/BaseContact.java b/src/org/mxchange/jcore/contact/BaseContact.java index 26dc172..6cf33db 100644 --- a/src/org/mxchange/jcore/contact/BaseContact.java +++ b/src/org/mxchange/jcore/contact/BaseContact.java @@ -17,6 +17,7 @@ package org.mxchange.jcore.contact; import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; import java.text.MessageFormat; import java.util.Iterator; import java.util.Map; @@ -484,7 +485,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * @return Value from field */ @Override - public Object getValueFromColumn (final String columnName) throws IllegalArgumentException, NoSuchMethodException { + public Object getValueFromColumn (final String columnName) throws IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace(MessageFormat.format("columnName={0} - CALLED!", columnName)); @@ -569,7 +570,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * @return Whether all conditions are met */ @Override - public boolean isValueEqual (final String columnName, final boolean bool) throws NoSuchMethodException { + public boolean isValueEqual (final String columnName, final boolean bool) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message this.getLogger().trace(MessageFormat.format("columnName={0},bool={1} - CALLED!", columnName, bool)); @@ -600,7 +601,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * @return An iterator */ @Override - public Iterator> iterator () throws NoSuchMethodException { + public Iterator> iterator () throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { return this.fieldIterator(this, "BaseContact"); } diff --git a/src/org/mxchange/jcore/contact/Contact.java b/src/org/mxchange/jcore/contact/Contact.java index 1d7c501..031c64a 100644 --- a/src/org/mxchange/jcore/contact/Contact.java +++ b/src/org/mxchange/jcore/contact/Contact.java @@ -17,6 +17,7 @@ package org.mxchange.jcore.contact; import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; import java.util.Iterator; import java.util.Map; import org.mxchange.jcore.FrameworkInterface; @@ -33,8 +34,10 @@ public interface Contact extends FrameworkInterface { * * @return An iterator * @throws java.lang.NoSuchMethodException If the invoked method was not found + * @throws java.lang.IllegalAccessException If the method cannot be accessed + * @throws java.lang.reflect.InvocationTargetException Any other problems? */ - public Iterator> iterator ()throws NoSuchMethodException; + public Iterator> iterator ()throws NoSuchMethodException, IllegalAccessException, InvocationTargetException; /** * Some "getter" for translated gender of the contact