Javadoc @throws clause at a class level for all methods

hello
If all my class's methods throw the same RuntimeException for the same reasons, is there a way to put a @throws clause at class level?
I mean, I don't want to duplicate my comments for each of the methods I have. Say I want to add extra information... It would be a pain to copy paste same
comment for all the methods.
Thx in advance, any help welcomed :)

kux wrote:
hello again
first of all, love your replay :). Nice to see people with good sense of humor :D
Ok, I made the story shorter. Of course I don't throw a raw RuntimeException. What I have is a subclass of RuntimeException. Basicly all my methods use a sql Connection and do a certain querry on a database. What I do is that I don't let checked SQLException propagate through my methods because the clients of the persistance layer should not be required to handle the low level sql exeptions.Correct!
Instead I catch them and rethrow them as DAOExceptions that SUBCLASS RuntimeException. Unusual... but... Hmmm... I can't say that's actually "bad practice", per se, but DAOException is traditionally a checked exception type thrown only from the very top of the DAO specifically so that clients must catch (or explicitly throw) it... Hmmm..
Basicly I used sun's DAO pattern: http://java.sun.com/blueprints/patterns/DAO.html.
That's be The GOF's pattern... but yeah, good choice.
I made the question shorter because this is not the point. The question was about javadoc, not my programming practices :)But, but, but...
Ok... Ah... Ok.... Ummm, No. At least Not That I Know Of... BUT, what you can do is summarise your exception handling strategy once in the class summary section, and just reference it in each throws clause... you can stick intra-page links in java doc (I've seen them, just not sure how they're done, I think the syntax is something like {@link:anchor}... but that's just something I once saw somewhere... not gospel.
Also, if a method has throws DAOExceptions for an "odd" reason (like invalid data retrieved successfuly from the database (yes, it happens)) then you can still document that case in the method.
If your exception handling is really worth talking about then an external article referenced in the class summary. We use a wiki (http://en.wikipedia.org/wiki/DokuWiki) for such purposes, and many others including research schedules and papers, and (increasingly) design doco, even though that's outside the "official process" we find the wiki so much more convenient (i.e. searchable), especially since it's become possible to convert (simple) word-doc's straigth to wiki markup.
But, but, but... Programming practices are so much more interesting than documentation... who ever complained about in the documentation (besides me I mean).
Cheers mate. Keith.

Similar Messages

  • Hi, how can I keep the same zoom level for all the pages I view in Safari and even when I close and open it.  Indeed with a 27 inch Imac I have a lot of space, most of the websites are built for smaller resolutions  and my sight is dropping !   Thx

    Hi, how can I keep the same zoom level for all the pages I view in Safari and even when I close and open it.  Indeed with a 27 inch Imac I have a lot of space, most of the websites are built for smaller resolutions  and my sight is dropping !   Thx

    Hi, how can I keep the same zoom level for all the pages I view in Safari and even when I close and open it.  Indeed with a 27 inch Imac I have a lot of space, most of the websites are built for smaller resolutions  and my sight is dropping !   Thx

  • How do I get the volume on my ipod classic to the same level for all songs?  Some are louder than others.

    How do I get the volume on my ipod classic to the same level for all songs?  Some songs are a lot lower than others.

    Coverflow in iTunes is sorted by Album Artist whereas coverflow on the iPod classic is sorted by Artist. Unfortunately, there is no way to set this on your iPod. This is such a fumble on Apple's part that I'm beginning to think they're becoming another Microsloth with buggy firmware and products.

  • Report at Material level(for all the plants)?

    Hi Experts,
    We have simple query which gives following output.
    &Plant&Material No&Creation Date&Issue date&QTY issued&
    P1      M1         01/10/2004    01/01/2005        10
    P2      M1         01/12/2004    15/12/2004        20
    P3      M1         01/01/2005    15/01/2005        30
    Actually I want to report at material level  ( for all plants in one shot ) , additionaly I want to show the minimum creation date for that material and minimum issue date  and sum of all 3 qty issued.
    The output should look like
    &Material No&Creation Date&Issue date&QTY issued
    M1           01/10/2004    15/12/2004       60
    Can any body suggest how do i get the date fields with the above condition
    Thanks in advance.
    Regs,
    Mahantesh

    Hi Mahantesh ,
    Try this:
    Take two more KFs in the cube.
    1) Creation Date as KF
    Type: Date
    Exception aggregation : First value
    Aggregation reference : 0material.
    2) Issue Date as KF
    Type: Date
    Exception aggregation : Last value
    Aggregation reference : 0material.
    In the query take 0material in rows and above 2 KF in the columns (May be , here , you need restriction also. 'Creation Date as Characterstic' > 01.01.1000 ,Issue Date as characterstic' < 31.12.9999 )
    With rgds,
    Anil Kumar Sharma .P

  • Retrieve permision levels for all items in list programatically

    Hi all,
    I need to retrieve all permission levels for all items in a list programatically using client object model in sharepoint 2010.Please send me the code sample.
    Regards,
    Praveen

    Hi Praveen,
    This blog has the code that you are looking for -
    http://www.learningsharepoint.com/2010/07/27/programatically-get-permissions-for-list-and-item-client-object-model-sharepoint-2010/
    or this forum for an idea -
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/6b16b407-203b-4c5b-9605-713904e9b22e/sharepoint-2010-how-to-get-a-list-of-permissions-for-each-individual-user?forum=sharepointadminprevious
    Hope this helps!
    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/

  • How to set transaction isolation level for a method in a Local Interface

              By reference at:
              http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              the value for method-intf can only be "Remote" or "Home".
              My question is--
              How to set transaction isolation level for a method inside a Local Interface or
              Local_Home Interface?
              Thanks.
              Xing
              

    I'd try 6.1SP2. I'm pretty sure this works now.
              -- Rob
              Xing wrote:
              > I tried "Local", but got an error when deploying the EJB jar, saying that only
              > "Remote" or "Home" is allowed.
              >
              > Any idea?
              >
              > Xing
              >
              > Rob Woollen <[email protected]> wrote:
              > >
              > >
              > >Use LocalHome or Local.
              > >
              > >-- Rob
              > >
              > >Xing wrote:
              > >
              > >> By reference at:
              > >> http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              > >> the value for method-intf can only be "Remote" or "Home".
              > >>
              > >> My question is--
              > >>
              > >> How to set transaction isolation level for a method inside a Local
              > >Interface or
              > >> Local_Home Interface?
              > >>
              > >> Thanks.
              > >>
              > >> Xing
              > >
              > >--
              > >
              > >----------------------------------------------------------------------
              > >
              > >AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              > >
              > >by Michael Girdley, Rob Woollen, and Sandra Emerson
              > >
              > >http://learnWebLogic.com
              > >
              > >
              > >
              > >
              > ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
              > ><html>
              > >Use LocalHome or Local.
              > ><p>-- Rob
              > ><p>Xing wrote:
              > ><blockquote TYPE=CITE>By reference at:
              > ><br>http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              > ><br>the value for method-intf can only be "Remote" or "Home".
              > ><p>My question is--
              > ><p>How to set transaction isolation level for a method inside a Local
              > >Interface
              > >or
              > ><br>Local_Home Interface?
              > ><p>Thanks.
              > ><p>Xing</blockquote>
              > >
              > ><pre>--
              > >
              > >----------------------------------------------------------------------
              > >
              > >AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              > >
              > >by Michael Girdley, Rob Woollen, and Sandra Emerson
              > >
              > >http://learnWebLogic.com</pre>
              > > </html>
              > >
              > >
              AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              by Michael Girdley, Rob Woollen, and Sandra Emerson
              http://learnWebLogic.com
              [att1.html]
              

  • How to get available quantity in Inventory levels  for all materials

    Hi..All
    I am Abap Developer and i have a Requirement that to Print a report that Displays " Inventory levels (available quantity) for all materials"
    1) What tables can i use to retrive the data to get the Inventory levels (available quantity) for all materials.
    2).What are the fields can used in that tables that use ful for end user.
    Thank you,
    Madhu .
    Edited by: madhubabu rao on Oct 15, 2008 9:10 AM

    Hi,
    I'm not sure what you mean when you are speaking about inventory levels and available quantity.
    I mean that you may have stock of 100 pcs of a certain material but from an open PrdOrd can come a reservation for this component (e.g. 20 pcs) that reduces this the available quantity (to 80 pcs).
    If you want only the stock levels, you don't have to write any ABAP code, since MB52 report is designed for this purpose.
    If you want to know the available stock (considering requirements (PIR, DepReq, SO), and stock-like MRP elements (PldOrd, PurReq, PrdOrd, PO, etc)) you should check report MD04 and examine how it works, which tables it uses (ST01).
    http://iorboaz.blogspot.com/2005/04/get-md04-data.html
    Regards,
    Csaba
    Edited by: Csaba Szommer on Oct 15, 2008 9:34 AM
    Edited by: Csaba Szommer on Oct 15, 2008 9:34 AM

  • Transaction Isolation Level for EJB methods

    L.S.
    I just found out the in OC4J one can not set the transaction isolation level on ejb methods. Moreover one needs to revert to bean managed transaction (manual coding of the ALL transaction logic) to set the isolation level.
    On entity beans one can only set the isolation level for the whole bean (not on individual methods), and in session beans there is no way at all to set the isolation level.
    This is on shear contract to all other application servers I used before (there one can declaratively set the isolation level for a ejb method, both in session and in entitybean deployment descriptors)
    Is it foreseen in a future release to include such a valuable feature will be provided by oc4j?
    Note that I was VERY surprised that OC4J could not handle this (I checked the j2ee spec, but admittedly the spec is a little vague about this support and makes it vendor dependent. the j2ee spec does not mandate this, except for CMP entity beans, but includes some suggestions on this ability. But most other application servers implemented the ability)
    Regadrs,
    Erik

    Hello Erik --
    I think we met in Perth recently?
    Anyway, your information is correct.
    We can set the transaction isolation level for each entity bean, at the bean level. We don't have for the specification of method level isolation settings -- I'd be interested to hear how you would like/do use this. What behaviour do you expect to see when a transaction is started that spans multiple methods on a bean with different declared isolation levels.
    For session beans, we do not currently have the ability to declaratively specify the isolation level to use for the bean. I know this is not in the forthcoming 904 release, and will to check what is beyond that.
    As you point out, this can be done programatically using the Connection.setIsolationLevel() method on any connections you are using from within the session bean.
    I'd would like to log an enhancement request for you for this functionality. Can you send me an email at [email protected] and we'll take it offline.
    -steve-

  • Do we need to be on the same HP level for all in a netweaver environment?

    Hi,
    We are on ECC6 with SAP_BASIS HP10.
    We would like to go to HP12 for extra functionalities but our CRM environment is on SAP_BASIS HP10.
    Our system administrator says that the HP level in the different environments
    has to be equal.
    This seems to me very strange because HP's are mostly bug fixes so what could be the relation between the CRM level and the ECC level?
    Thanks for any help,
    Hans

    Hi,
    It could be. All depends on the prerequisites of that package.
    Our system guys advice not to go for the packages though but for the stacks, where all dependencies are taken care for and checked by SAP.
    All info on stack/packages dependencies can be found at service.sap.com/swdc where you also download them.
    Eddy
    PS. Which type of SDN Ubergeek/BPX suit are <a href="/people/eddy.declercq/blog/2007/05/14/which-type-of-sdn-ubergeekbpx-suit-are-you">you</a>?

  • Print setting function not working to check ink levels for all in one 1350/windo​ws xp

    Just tried checking ink levels, on window xp/all in one 1350
    nothing happened when I clicked on print levels to get to tools,
    this has worked before.  Would appreciate any ideas.

    Hello joandcasey,
    Welcome to the HP Forums.
    The following document will show you how to check the ink levels on a Windows computer. Please click the following link for Replacing the Inkjet Print Cartridges.
    Please feel free to write me back if you have any other questions or concerns.
    Cheers,  
    Click the “Kudos Thumbs Up" at the bottom of this post to say “Thanks” for helping!
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    W a t e r b o y 71
    I work on behalf of HP

  • Class Loader for Jar Files

    I have a set of Jar files which i need to load using Custom Class Loader. Any one who has Javacode for Custom Class Loader for loading Jar files send it. The Jar files are local jar files.

    Here is the class loader I use:
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.net.JarURLConnection;
    import java.lang.reflect.Method;
    import java.lang.reflect.Modifier;
    import java.lang.reflect.InvocationTargetException;
    import java.util.jar.Attributes;
    import java.io.IOException;
    * A class loader for loading jar files, both local and remote.
    public class JarClassLoader extends URLClassLoader {
        private URL url;
        private URL[] m_urlList = new URL[10];
         * Creates a new JarClassLoader for the specified url.
         * @param url the url of the jar file
        public JarClassLoader(URL url,ClassLoader cl) {
             super(new URL[] { url },cl);
          this.url = url;
        public JarClassLoader(URL[] urlList,ClassLoader cl) {
             super( urlList,cl);
          this.m_urlList = urlList;
         * Returns the name of the jar file main class, or null if
         * no "Main-Class" manifest attributes was defined.
        public String getMainClassName() throws IOException {
          URL u = new URL("jar", "", url + "!/");
             JarURLConnection uc = (JarURLConnection)u.openConnection();
             Attributes attr = uc.getMainAttributes();
             return attr != null ? attr.getValue(Attributes.Name.MAIN_CLASS) : null;
         * Invokes the application in this jar file given the name of the
         * main class and an array of arguments. The class must define a
         * static method "main" which takes an array of String arguemtns
         * and is of return type "void".
         * @param name the name of the main class
         * @param args the arguments for the application
         * @exception ClassNotFoundException if the specified class could not
         *            be found
         * @exception NoSuchMethodException if the specified class does not
         *            contain a "main" method
         * @exception InvocationTargetException if the application raised an
         *            exception
         public void invokeClass(String name, String[] args) throws ClassNotFoundException,
                NoSuchMethodException,
                InvocationTargetException
             Class c = loadClass(name);
             Method m = c.getMethod("main", new Class[] { args.getClass() });
             m.setAccessible(true);
             int mods = m.getModifiers();
             if (m.getReturnType() != void.class || !Modifier.isStatic(mods) || !Modifier.isPublic(mods)) {
             throw new NoSuchMethodException("main");
             try {
               m.invoke(null, new Object[] { args });
             } catch (IllegalAccessException e) {
             // This should not happen, as we have disabled access checks
    }

  • Default Exchange rate type at document type level for parallel currencies

    Hi,
    I have a scenario wherein 2 parallel currencies have been maintained (Grp & index based) against a Co Code and have maintained a default exchange type (Z2) in the Document type settings (OBA7).
    But when I want to post a foreign currency document, system picks Z2 rates for Co Code currency conversion and not for Grp & index based. In fact it picks M rate for these addtional currencies.
    I know that for parallel currencies, the system will always use the exchange rate type defined in transaction OB22 ( "M" rate) which is at Co Code level but I want default exchange rate type Z2 to be picked at Document Type level for all the parallel currencies.
    Please suggest how to archive this.
    Thanks,
    Sam

    Dear Sam,
    The exchange rate type defined in the FI document type (-> field
    exchange rate type in transaction OBA7) is only used for the currency
    translation from transaction/document currency into first local
    currency, not for the currency translation into second local (group)
    currency or for the currency translation into third local currency.
    The exchange rate types for the currency translation into second
    local (group) currency and third local currency are defined in
    transaction OB22.
    Unfortunately there is no option to change the exchange rate of 2nd or
    3rd local currency in our posting transactions. The design doesn't
    regard that requirement. But you have the chance to adjust the parallel
    currencies in OB22 or to change the amounts manually.
    I hope this helps.
    Mauri

  • Batch auto exposure or auto levels for a bunch of RAW images?

    Hi,
    I want to apply the "auto level" to a bunch of RAW images all at the same time. I've tried to use the lift+stamp tools, but they lift the applied level instead of the function "auto level" itself, and thus uses the same levels for all the images. I've also tried to uncheck the "Primary only" function, but it still doesn't work - if I select a bunch of photos and press "Auto level", only one of them will have it applied.
    Does anyone have an idea of a way to do this?
    Thanks!

    There was a post a week or so back that discussed this and one way of achieving it.
    http://discussions.apple.com/thread.jspa?threadID=2216247
    Tony

  • Privilege level for the commands

    Hi All,
    I am trying to modify the privilege level of the commands in my router.
    I need to understand what is the privilege level for the commands.
    Is there a command in the IOS or a link with a document on the CCO with the criteria or the list of the command and its corresponded privile level.
    Thanks
    Matteo

    Matteo
    I am not clear what it is that you are trying to do. But let me make a suggestion. While there are 16 privilege levels (0 through 15) there are two levels that are commonly used 1 and 15. 1 is what is usually called user mode and is the default level when someone first logs into the router. My suggestion is to identify what group of commands you do not want to be available in user mode, decide if they should be available in something less than 15, pick a level, and assign the commands to that level.
    If you really do want to start from a list of commands and their privilege level, I do not think that you will find any single source which will accurately give you the privilege level for all commands. The closest you will find is to look in the command reference and find the command. The command reference will usually describe the privilege level. Unfortunately I have found a few situations where the description of privilege level was not correct.
    My advice is that if you want to find the privilege level for some commands that you want to manipulate, that you get a router and try the command and determine what its privilege level is.
    HTH
    Rick

  • For all entries.. with agregate functions....help

    Hi ppl,
    I want to put this select query outside loop using for all entries but it doesnt support group by neither aggregate funstions like sum.
    its not giving correct results if i use collect or sum even using control break statements .
    plz help..
    LOOP AT T_UNITS.
        V_TABIX = SY-TABIX.
         get GLPCA postings
        SELECT AWTYP AWORG RACCT REFDOCNR SUM( HSL ) FROM GLPCA "1062
            INTO TABLE T_GLPCA
            WHERE RPRCTR = T_UNITS-UNIT
            AND   RACCT  IN S_HKONT
            AND   KOKRS = V_KOKRS
            AND   RYEAR = P_GJAHR
            AND   POPER  <= P_MONAT
            GROUP BY  AWTYP AWORG RACCT REFDOCNR.               "GK_166118
        SORT T_GLPCA BY AWTYP AWORG REFDOCNR.                   "1062
         process GLPCA postings
        LOOP AT T_GLPCA.
    endloop.
    some code
    endloop.
    thanks
    Archana

    ... FOR ALL ENTRIES IN itab WHERE cond
    Effect
    Only selects the records that meet the logical condition cond when each replacement symbol itab-f is replaced with the value of component f of the internal table itab for at least one line of the table. SELECT ... FOR ALL ENTRIES IN itab WHERE cond returns the union of the solution sets of all SELECT statements that would result if you wrote a separate statement for each line of the internal table replacing the symbol itab-f with the corresponding value of component f in the WHERE condition.Duplicates are discarded from the result set. If the internal table itab does not contain any entries, the system treats the statement as though there were no WHERE cond condition, and selects all records (in the current client).
    Example
    Displaying the occupancy of flights on 28.02.2001:
    TYPES: BEGIN OF ftab_type,
             carrid TYPE sflight-carrid,
             connid TYPE sflight-connid,
           END OF ftab_type.
    DATA:  ftab TYPE STANDARD TABLE OF ftab_type WITH
                     NON-UNIQUE DEFAULT KEY INITIAL SIZE 10,
           free TYPE I,
           wa_sflight TYPE sflight.
    Suppose FTAB is filled as follows:
    CARRID  CONNID
    LH      2415
    SQ      0026
    LH      0400
    SELECT * FROM sflight INTO wa_sflight
        FOR ALL ENTRIES IN ftab
        WHERE CARRID = ftab-carrid AND
              CONNID = ftab-connid AND
              fldate = '20010228'.
      free = wa_sflight-seatsocc - wa_sflight-seatsmax.
      WRITE: / wa_sflight-carrid, wa_sflight-connid, free.
    ENDSELECT.
    The statement has the same effect as:
    SELECT DISTINCT * FROM sflight INTO wa_sflight
        WHERE ( carrid = 'LH'   AND
                connid = '2415' AND
                fldate = '20010228' ) OR
              ( carrid = 'SQ'   AND
                connid = '0026' AND
                fldate = '20010228' ) OR
              ( carrid = 'LH'   AND
                connid = '0400' AND
                fldate = '20010228' ).
      free = wa_sflight-seatsocc - wa_sflight-seatsmax.
      WRITE: / wa_sflight-carrid, wa_sflight-connid, free.
    ENDSELECT.
    Notes
    You can only use ... FOR ALL ENTRIES IN itab WHERE cond in a SELECT statement.
    In the logical condition cond, the symbol itab-f is always a replacement symbol, and should not be confused with the component f of the header line of the internal table itab. The internal table itab does not need to have a header line.
    Each component of the internal table that occurs in a replacement symbol in the WHERE condition must have exactly the same type and length as the corresponding component in the database table.
    You cannot use replacement symbols in comparisons in LIKE, BETWEEN, or IN expressions.
    If you use FOR ALL ENTRIES IN itab, you cannot use ORDER BY f1 ... fn in the ORDER-BY clause.
    If you use FOR ALL ENTRIES IN itab, you cannot use a HAVING clause as well.
    Sameer

Maybe you are looking for