[jdom-interest] help please

Paul Jakubik pauljakubik at yahoo.com
Wed Mar 14 08:33:23 PST 2001


Due to the way Java works, there is no magic to be
able to avoid an import statement. You would have to
go and edit the source code of all the JDOM classes so
they wouldn't be in a package anymore.

This would be a bad idea since JDOM uses generic names
like Document and Element.

An option that reduces the number of imports is to do
something like the following:

import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
import org.jdom.adapters.*;

If you do that, you'll be able to use every JDOM class
without any additional imports. Of course, it won't be
obvious from your imports what classes you are using
from JDOM, and if you use this same style to import
from other libraries people reading your code will
have no idea which classes come from JDOM and which
come from somewhere else.

--Paul

--- Hugh Mc Gauran <hugh.mcgauran at skynet.ie> wrote:
> 
> well thanks to Paul Jakubik it now works
> 
> all i had to do was add import org.jdom.Document; at
> the top and it
> worked
> 
> what do i need to have in my classpath for this to
> be automagically in
> 
> hugh
> 
> On Wed, 14 Mar 2001, Ian Lea stated:
> > Hard to tell much from this.  Has the source got
> the correct import
> > statements?  Or try changing line 16 to
> org.jdom.Document doc =
> > whatever.
> > What exactly is your classpath set to?
> > 
> > 
> > --
> > Ian.
> > ian.lea at blackwell.co.uk
> > 
> > 
> > Hugh Mc Gauran wrote:
> > > 
> > > java 2 sdk v1.3
> > > 
> > > On Wed, 14 Mar 2001, GB/DEV - Philip Nelson
> stated:
> > > >
> > > > > cantona % javac InAndOut.java
> > > > > InAndOut.java:16: cannot resolve symbol
> > > > > symbol  : class Document
> > > > > location: class InAndOut
> > > > >
> > > > >       Document doc = b.build(new
> File(filename));
> > > > >       ^
> > > > > 1 error
> > > >
> > > > Appears to be a syntax error, but what version
> of java are you using?
> 
> -- 
> Regards
> Hugh
> 25 Plassey Vge,Castletroy, Limerick.
> House Tel 061 337125		 Mobile 086 8298 707.
> Email cantona at skynet.ie 	 Web
> http://hughmc.csn.ul.ie
> 
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/



More information about the jdom-interest mailing list