How best to include a copyright in JavaDoc?

Hello.
I am wondering how best to include a copyright notice, standard legal boilerplate, etc. in JavaDocs.
I realize that many developers include the text directly in a JavaDoc comment (perhaps using a template in their IDE for generating that automatically), but that seems less than ideal to me. Having a long boilerplate takes up a lot of unnecessary space in source files; with several hundred or thousand source files, that can be a big waste. Also, if the notice needs to be changed or updated, than going back to find and edit every instance of the notice can be challenging, even with a global search and replace. What I would like is basically the equivalent of an "include" tag that will include a single copyright notice wherever it appears, but JavaDoc does not appear to have a suitable feature.
The initial approach I have taken is to define a custom taglet with this ability. I am also playing with a custom annotation for noting copyrighted code as an additional reference to the copyright notice. The basic structure I have so far looks like this, in org.sample.legal:
- Copyright.java (interface defining a few constants such as default copyright date, default owner, etc. as well as the full default copyright notice)
- CopyrightAnnotation.java (annotation type for marking code as copyrighted)
- CopyrightTaglet.java (taglet for adding "@copyright" tags in JavaDoc)
Here's what the top of CopyrightTaglet looks like, to give a better sense of what it can handle:
package org.sample.legal;
import com.sun.tools.doclets.Taglet;
import com.sun.javadoc.*;
import java.util.Map;
* Represents the "@Copyright" tag.  If empty, the default copyright notice
* will be displayed.
* <p>This tag can be used in any overview, package, class, or interface
* {@link com.sun.javadoc.Doc}.  This is not an inline tag.</p>
* <p>The tag can display a default value, the default value modified with
* a different copyright date, or a completely custom value.  To display the
* default value, use "@Copyright" alone.</p>
* <p>To specify a different date, enter the copyright years separated by
* dashes (-) or commas (,); optional spaces are allowed.  For example, the
* following will be recognized as valid dates:</p>
* <ol>
* <li>"@Copyright 1999"</li>
* <li>"@Copyright 1999, 2000"</li>
* <li>"@Copyright 2001-2003</li>
* <li>"@Copyright 2001-3, 2005</li>
* </ol>
* <p>To display a completely custom value, simply enter whatever text is to be
* displayed after the "@Copyright" tag.</p>
* <p>The text is displayed in italics to remind the reader of its
* importance.</p>
* @Copyright
@CopyrightAnnotation
public class CopyrightTaglet
implements Copyright, Taglet {
private static final String NAME   = "Copyright";
private static final String HEADER = "Copyright:";The "@Copyright" tag by itself produces output (based on the constants in the Copyright interface) like this:
Copyright:
Copyright &copy; 2008 by Sample Organization. All rights reserved.
I have this all working fine, but my main question concerns whether this is a reasonable approach. Is there a better approach to this problem of making a single copy of the copyright text available everywhere? What other approaches are common?
Thanks for any advice.
Edited by: Richard.J.Barbalace on Jun 25, 2008 9:16 AM
Edited by: Richard.J.Barbalace on Jun 25, 2008 9:18 AM
Edited by: Richard.J.Barbalace on Jun 25, 2008 9:20 AM
Edited by: Richard.J.Barbalace on Jun 25, 2008 9:22 AM

Your approach lets you choose which classes, interfaces and members are copyrighted, or apply different copyrights for different parts of the source code. But in many cases (such as the Java API), the entire published API gets the same copyright notice. So we put the notice in the footer of each page:
-bottom '<font size="-1">Submit
a bug or feature<br><br>Java is a trademark or registered trademark of Sun Microsystems,
Inc. in the US and other countries.<br>Copyright 1993-1999 Sun Microsystems, Inc.
901 San Antonio Road,<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font>' ^
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#commandlineexample
-DOug

Similar Messages

  • How (best) to include links in a template?

    I'm creating a ~55 page site, where most of the structure of
    the site (3 nav bars, etc.) will be similar throughout. I know the
    client will change the order and names of the links, as well where
    they point. Yet they want to have it mostly created first.
    I thought working from a template would be the best, but I
    would then be unable to disable the link of the current page, say,
    the "home" button when I'm already on the home page etc. Can anyone
    advise a work-flow that would allow me to just edit something once
    and propagate it throughout when I need to, yet not when I don't?
    Thank you so much!
    Nick

    Take a look at my divaGPS for this. With divaGPS added to
    your template,
    you can freely change the menus, their links, whatever you
    want, and
    divaGPS will still highlight AND disable the link on the the
    current
    menu item automatically when the page is viewed in the
    browser.
    fyi divaGPSfree might be adequate for you except for the fact
    that it
    will not disable the current menu item's link, which is a
    feature you
    requested. Some people feel it is okay merely to force the
    cursor (via
    css) back to the default pointer. If you agree, then
    divaGPSfree might
    be adequate. However, if you prefer to truly disable the
    current link,
    then divaGPS is what you'd need.
    Either work perfectly in Templates or their Children with now
    special
    steps needed.
    http://divahtml.com/products/divaGPS/current_menu_location.php
    http://divahtml.com/demo/index.php
    E. Michael Brandt
    www.divahtml.com
    www.divahtml.com/products/scripts_dreamweaver_extensions.php
    Standards-compliant scripts and Dreamweaver Extensions
    www.valleywebdesigns.com/vwd_Vdw.asp
    JustSo PictureWindow
    JustSo PhotoAlbum, et alia

  • How best to include additional on-page info (*as well as*) page numbers in a Table of Contents?

    Hi all -
    I'm creating a directory / listings document. At the end of the publication, I need to create a "quick reference" section - with an alphabetised listing of each entry, some key info from each entry, and the page number for each entry.
    I've created a unique paragraph style for each of the lines that I need to include here - so the Table of Contents is picking them up successfully.
    However, I'm struggling to style the outputs of the Table of Contents the way I need: I want a tab between each of the included paragraph styles that are returned for each entry, and then a line return at the end.
    So…
    First Hotel name -> Star Rating -> Number of Bedrooms -> etc etc
    Second Hotel name -> Star Rating -> Number of Bedrooms -> etc etc
    Instead of…
    First Hotel name
    Star Rating
      Number of Bedrooms
       etc
    Second Hotel name
    Star Rating
      Number of Bedrooms
       etc
    Any suggestions?
    One important point to note - I'm using CS5.5… an upgrade is in my future, but I want to finish this project first! (Don't want to switch mid-stream.)
    Thanks!

    Thanks. I went there and bulleted align by decimal, but it didn't work on the page. For one thing, when I highlight that page, for some weird reason the numbers from 9 up DO NOT HIGHLIGHT. !  Only the text following those numbers highlight, altho all the other numbers and text following 9 highlight!
    Don't know why it would have this weird situation! Seems like a flaw in the design.
    I tried moving the little blue cursors above, but I'd need to move it half a step either way to bring those one-digit number decimals in alignment with the rest. For some reason the cursors will ONLY move a full step! So they're out of alignment no matter what I do. Darn!
    Kristen
    gemsandbeyond at aol dot com

  • One Computer, Two Accounts - How Best to Proceed with MacOS 10.8.2?

    My wife and I want to share our new iMac, and I'd like some advice on how best to do this without messing things up.
    We both have iOS devices to sync, and we both are using the same iTunes Store Account. However, we each have our own iCloud account. We each have our own email accounts, Hotmail accounts, and Yahoo accounts. We each have our own account for the iMac, which I assume you would need if you wanted to maintain two different sets of Mail accounts and two different Facetime "accounts," what to speak of different desktop customization options. 
    Things we would like to share without duplicating files include: iPhoto library (~100 GB), iTunes media files (over 300 GB), Contacts list, (maybe) Calendar, and (maybe) Safari bookmarks. We do NOT want to share e-mail, Reminders, Facetime. Ideally, I would like for her to be able to sync her devices entirely through her iMac account. However, I am not opposed to her syncing her iOS devices through my account for some things and through her account for other things, if that is not easily avoidable.
    Regarding the iTunes library, I could go either way on her having separate library files with separate ratings & playlists or just sharing the same library setup that I have. However, I would want her to have access to the same metadata that I have for all music and video files, since I have lots of custom album art as well as lyrics loaded in. Do we have to use the same library file in order to have access to the same metadata, which will be updated on a regular basis?  If so, then is there a way to do that via two different computer accounts, or does she pretty much have to sync with my account?
    Now regarding iPhoto libraries, I wouldn't mind us sharing the same "library" as well as the files, including ratings and albums. I would like for the "faces" setup to be the same for both of us, if possible, so that she does not have to repeat the process of face tagging. I read in an older article that sharing the iPhoto library could be accomplished by sending the iPhoto library file to an external hard drive, but as that seemed to be an older approach, I thought I would ask here if that is still the ideal approach. I might want to send the iPhoto library file to an external HD anyway for space considerations. But if I do this, and we are both using the same library file for viewing photos, then does she still see the same albums, events, and tags that I have created already?
    Is there a way to share contacts and calendars without having to share other things like Notes and Reminders? I suppose I could have her sync this information via my account, but I'd be greatful to learn of a better way if there is one.

    You can share out both the iTunes library and the iPhoto Library in their respective preferences. However, the sharing account must have both iTunes and iPhoto running. You can keep the account running with those things open in the background using Fast User Switching. Enable that in the Users & Groups system prefs and then never log out, just switch to the login screen or the other account using the Fast User switching menu.
    I haven't done much actual use in either, so I don't know what the limits are (like making a playlist out of the shared tracks, syncing with iPhone/iPod, etc). For iPhoto, all the photos are available, but if you want to edit one, you have to import a copy into your own library. Another option might be to not keep the media inside the Library, but store it in the /Users/Shared folder. Then, set up your Libraries to leave the content where it is (Preferences). However, I don't think you'd get the metadata for the iTunes music. I believe that is all stored within the iTunes Library.
    You can share iCloud calendars so the other person can see your calendar by right-clicking on the Calendar name. There will be an option to share the calendar, there. Also, you can do so from the iCloud web interface.
    I've got nothing on sharing contacts. Not sure of a good way to do that besides maintaining two sets. You can start from the same source, but it will diverge over time as contacts are added and removed individually.

  • How best to migrate from MacPro to iMac w/ SSD and extrenal drives

    Currently I have a MacPro with 4 drives - 3 1TB and 1 2Tb, the 2TB drive is my main hard drive, so it has system, apps, documents, itunes etc....and it has been upgraded and migrated from one computer to the next as long as apple has had the ability to do so (and before that by moving over targeted drive manually). I currently am running 10.6.8 on the machine. I have ordered a new iMac w/ an internal 512gb SSD drive, and after speaking with an Apple rep, I got a THunderbolt enclosure to house my current 4 hard drives. Now my question is how best to get my preferences etc into the new computer w/o dragging along all the old stuff...(ie old apps not compatible w/ Mountain Lion, old system folders, etc). Here is what I would like to do:
    1. setup SSD with OS, fresh installs of Apps, and my fonts (i am a designer and i have a gazillion fonts and they always take way to long to load into my font app).
    2. I would like my 2TB drive to eventually just include my home directory where all my files, and such will be stored. But I would like to keep the drive as is to make sure everything is working just in case, I dont want to have any down time during the upgrade process (ie if a client calls me and needs something while I am still setting up I could boot off the 2tb drive and work). But after all is working properly then I would like to make it just the home directory and main place for all files etc
    3. My remaining 3 drives are broken up for manual backups of my work on 2 of the drives, and then photos and mp3s on one, and movies and tv shows from itunes on the other. I dont currently run Time Machine or Retrospect or RAID....
    I see most people saying to create 2 admin accounts, one that would stay on the SSD drive and the other which could be mapped to the 2TB drive and have its home directory there...but what do I do about moving preferences etc? is there a way when setting up that will let me import my current account and let me keep it on the external drive as is? should i move the files that i want to keep off the 2tb drive, wipe it to get rid of the old apps and system and then put back the home directory??I don't want to run into trouble with permissions, and I really dont even want to create 2 accounts because I hate having to close everything and log out for simple installs and updates...i have 2 on my macbook pro now and i run into errors all the time of i cant update this or that because of admin account...even though both accounts are set as admin.
    I want to keep the whole upgrade simple, but I would like to keep this fresh system clean as  am sure there is way to much left over garbage from upgrades past. So just not sure how best to do any of it.....

    I purchased the DataTale RS-M4t SMART 4-Bay Thunderbolt RAID storage enclosure. But it can do both RAID if you get their data manager software download, or it can just mount the drives and be used normally. So basically I can plug all 4 of my current drives into it...and it into my iMac and it will be same as if I had it in my tower....so really not moving over a ton of stuff. I will load all apps fresh onto the brand new iMac - so the SSD will be a clean install...my worries are trying to get access to home directories etc on the current main drive and have things get setup correctly, keychains, bookmarks, etc...as well as my iTunes which has iPad and iPhone backups, etc. I am just not sure as how to best setup the SSD to get the most of its speed while being able to get my current account working but on the second external drive.

  • Hi, Can anyone recommended software to import dvd to iMovies. I need to import about a dozen homemade DVD's and edit them into a single DVD comprising the 'best bits'. How best can I do this. I have an external hard drive available for the job

    Hi, Can anyone recommended software to import dvd to iMovies. I need to import about a dozen homemade DVD's and edit them into a single DVD comprising the 'best bits'. How best can I do this. I have an external hard drive available for the job

    You need to convert the VOB files in the TS-Folder of the DVD back to DV which iMovie is designed to handle. For that you need mpegStreamclip:
    http://www.squared5.com/svideo/mpeg-streamclip-mac.html
    which is free, but you must also have the  Apple mpeg2 plugin :
    http://store.apple.com/us/product/D2187Z/A/quicktime-mpeg-2-playback-component-f or-mac-os-x
    (unless you are running Lion in which case see below))
    which is a mere $20.
    Another possibility is to use DVDxDV:
    http://www.dvdxdv.com/NewFolderLookSite/Products/DVDxDV.overview.htm
    which costs $25.
    For the benefit of others who may read this thread:
    Obviously the foregoing only applies to DVDs you have made yourself, or other home-made DVDs that have been given to you. It will NOT work on copy-protected commercial DVDs, which in any case would be illegal.
    And from the TOU of these forums:
    Keep within the Law
    No material may be submitted that is intended to promote or commit an illegal act.
    Do not submit software or descriptions of processes that break or otherwise ‘work around’ digital rights management software or hardware. This includes conversations about ‘ripping’ DVDs or working around FairPlay software used on the iTunes Store.
    If you are running Lion or later:
    From the MPEG Streamclip homepage
    The installer of the MPEG-2 Playback Component may refuse to install the component in Lion. Apple states the component is unnecessary in Lion onwards, however MPEG Streamclip still needs it. See this:
    http://support.apple.com/kb/HT3381
    To install the component in Lion, please download MPEG Streamclip 1.9.3b7 beta above; inside the disk image you will find the Utility MPEG2 Component Lion: use it to install the MPEG-2 Playback Component in Lion. The original installer's disk image (QuickTimeMPEG2.dmg) is required.
    The current versions of MPEG Streamclip cannot take advantage of the built-in MPEG-2 functionality of Lion. For MPEG-2 files you still need to install the QuickTime MPEG-2 Playback Component, which is not preinstalled in Lion. (The same applies to Mountain Lion even though that has it preinstalled.) You don't have to install QuickTime 7.

  • How can I include Customer Hierarchy in Customer master IDoc -DEBMAS06 ?

    Hi,
    I am generating Customer master IDoc using basic message type DEBMAS06. But when I include customer hierarchy data while creating customer master, it is not included in any of the segments. The segment containing the data from KNVH is not included in standard.
    How do I include this hierarchy data in the IDoc? If I create a segment, under which basic segment should it  be included and how to update the data in the segment?
    Can anybody help?
    Points assured.
    Best Regards,
    Rajendra

    Hi
       You can use LSMW :-
    1) Create a project , sub project and an object.
    2) execute it from 1 st screen to enter the object.
    3) You will find proces steps.
    4) In Maintain Object Attributes  choose Program Name RFBIDE00.
    or I-DOC or the way you want the input to be.
    5) You can proceed from there following the instruction..

  • How can I include results of a subsequenc​e, which runs in a new thread, in the main sequence test report

    Hi!
    I', m working with TestStand Version 4.2.1. I have a main sequence, which calkls different subsequences. All these steps are properly reported. One of subsequences runs as "new thread". How can I include its results in common test report of the main sequence?
    I have markes variables of the subsequence as it is requred for test report (it works OK if it is not a new thread). If the the numerical test, which is executed in this subsequence is correct, I get no results at all. If the numeric test failed I get somewhere in the main sequence report a "red message", that test failed whithout any reference to the step or values of vaiables which were not correct.
    I tried an option "On the fly" in the Report Configuration , but haven' got any useful results. What shall I do?
    Best regards
    Solved!
    Go to Solution.

    Hi,
    I tried it but without success:
    1) I got a reference to the Thread as "Locals.Step1=RunState.Thread" for every of 2 steps which start a thread
    2) I put both "Waits" after steps with (and without) threads, at the same place, where they were before
    3) The sequence run OK, but when it came to Wait for Thread 1 it waited for ever, I had to terminate sequence
    Does it mean, that I got a false reference (suppose No - please, have a look at attached pic)?
    Or does it mean, that Waits are badly placed in the sequence (threads are already terminated)? Here is a pic of sequeces calls with Wait after them.
    Regards
    Attachments:
    Thread.JPG ‏34 KB
    SequenceCall.JPG ‏32 KB

  • How do I include javax.ejb.EJB in a Web Project?

    Hi,
    I have set up an application with two projects. One is called EJBModel and the other is UserInterface. In my UserInterface project, I am writing a bean class and I want it to access the controller beans created in EJBModel. I created a private type for the controller bean and used the @EJB annotation. When I try to import javax.ejb.EJB I get an error saying it is not found. Other javax packages popup on the list of available imports, but not ejb. How do I include it in the UserInterface project?
    Thanks in advance...

    Yeah your right...let me further explain what I'm doing.
    I'm creating a web application using the Model-View-Controller design pattern. Model represents data, View represents data display, and Controller is control. I created the EJBModel project in my web app to contain the model aspect. So it has entity objects and beans to access/manipulate the data. Then I created the UserInterface project to store the web interface - mostly jsps. In the UserInterace project, I need a managed bean that calls methods from the beans created in the EJBModel project. I can do this using the @EJB annotation and creating an instance of the class, but since the files are in separate projects that can't see each other and JDeveloper shows an error because it can't find the necessary file. It is best practice to create two projects to keep both elements distinct.
    So I wanted to know the best way to access the files stored in separate projects within the same application.

  • How do you include date in PDF export from Keynote 6.2.2

    In Keynote '09, I used to be able to insert the date in the bottom of a PDF export. Now that I upgraded to Mavericks, Keynote (6.2.2) appears to only have the option to "include name and date".
    That's a useless combination. Those are 2 different things: (1) the filename, and (2) the date. At best, those should be two separate checkboxes.
    I miss the feature to add ONLY the date to the PDF generated. I haven't upgraded to Yosemite yet but don't have my hopes up that this feature exists.
    Am I missing something? How can I include the date in a PDF exported/printed/saved from a Keynote presentation?

    Events are purely automatic, and will only organise on the date and time.
    Make an Album of the photos and then you can drag them to any order you want.
    Regards
    TD

  • How I can include several sequences in one sequence file?

    I am new for teststand and forgive me if my question seems silly.
    How I can include several sequences in one sequence file? I would like to use " call sequence" in current file.
    thanks a lot for your kind help

    Hey gunking,
    If you'd like to find out more information about our training courses, I'd be happy to speak with you further about what the course contains and locations offered, but it's probably best if we take this off of the forums for further conversation via phone or email.
    Create a new support request at www.ni.com/contact and set the product as TestStand.  You will be directed to myself or another engineer on my team, at which point you can ask for me or just speak with one of my teammates.
    Off the top of my head, I do know that there are a few courses coming up in Austin in the next couple of weeks (I'm teaching one myself), if you're interested in those.  Otherwise, courses are always being added for the future.
    Derrick S.
    Product Manager
    NI DIAdem
    National Instruments

  • How best to use catalogs, collections etc

    I wonder if anyone can help out on a newbie question about how best to use catalogs, collections, etc
    Let's say I shoot an event A.  I take loads of photographs, which I import into Lightroom.  I choose some that I like and I flag them.  So far so good.
    Then I do the same for events B to Z.
    Now time passes and I would like to go back to all of the photographs from event C, and just select them for further processing.
    Is this what collections are for?  Should I be making "All Of Event C" into a collection, then in the future I can come back and just ask to show the photographs from a given collection?
    Many thanks,
    regards,
    /alan

    alan_potter had this to say:
    I wonder if anyone can help out on a newbie question about how best to use catalogs, collections, etc
    Let's say I shoot an event A.  I take loads of photographs, which I import into Lightroom.  I choose some that I like and I flag them.  So far so good.
    Then I do the same for events B to Z.
    Now time passes and I would like to go back to all of the photographs from event C, and just select them for further processing.
    Is this what collections are for? 
    You can do it that way.
    >Should I be making "All Of Event C" into a collection, then in the future I can come back and just ask to show the photographs from a given collection?
    That would work. Or you could include a specific job identifier into the
    metadata (I believe there's an IPTC field specifically for that), and
    then make a smart collection that isolates just that value of "Event C".
    If you use the same star ratings for all jobs - 1 is finished, 2 is
    further work needed, 3 is review, etc - you could further winnow it
    down. And that way, you don't have to worry about removing photos from
    one collection or another; the smart collection will automatically add
    or remove them from view, based on the criteria and the current values
    of the photos.
    With collection sets, you could have a set called "Event 1". And within
    this set could be the various collection criteria mentioned above.

  • How i can include smarform output as a body text in Email

    Hi experts,
    Can anybody tell me how i can include smartform output ( invoice related data) as a body text in an Email .
    Regards,
    Ratheesh

    Hi,
    You will have to generate the spool of your smartform output & capture the spool in internal table.
    Pass the same to your Email body.
    Search using text "Smartform spool email" & you will get a sample code.
    Best regards,
    Prashant

  • How best to manage global forms

    Looking for the best way to manage "Global forms". Where the same form (Output) may have different data displayed based on the country it is printed from.
    Let's just use BA00, Order Confirmation as an example.
    In the U.S. this output is on 8.5 X 11 inch letter paper, and has some specific texts which should be displayed in certain locations.
    For Britain, we'd like to use the same form, but this will print on A4 paper, and have their own specific texts (in specific form locations)
    Same difference for China, Greenland, Mexico, etc. Assume each "Country" is a Sales Organization in SAP.
    How best to manage the output form configuration and controls?
    If I use a condition record for BA00 that includes Sales Organization, is it left up to the SMARTFORM programmer to query the sales org. and determine what and where to output the appropriate texts for each country?
    Is there a way to have a different form for each Sales Org, and how would this fom be "selected"?
    Anyone got any other ways to more efficiently handle this situation ?
    Thanks in advance

    Crikey ! Thanks for the quick response. That is where I was going, but wanted to get some other viewpoints
    Thanks

  • How can I insert the copyright symbol

    How can I insert the copyright symbol, I have tried the ALT + 0169 with no success.
    I want to include in a watermark brush

    Did you use the the alpha-numeric keys, the ones on the right of the keyboard?
    You can also get it (WINDOWS) via the character map:
    Type character map into the search box. You will find the symbol there. Select it, then copy, then paste into your document.

Maybe you are looking for