Re: [SrcML] SrcML DOM: Unit
Status: Beta
Brought to you by:
crashchaos
From: Frank R. <fra...@in...> - 2005-05-18 09:17:46
|
On Wed, May 18, 2005 at 10:59:53AM +0200, Leif Bladt wrote: > Can anybody explain me this constant variables (found in > de.srcml.dom.Unit.java)? I thought I could use them to get the > corresponding filename of a unit, at least the comments promise me > this. Sure.. here we go: > /** The programming language of this SrcML Unit */ > public final static String ATTR_LANGUAGE = "language"; This is one of the language strings defined in de.srcml.language.Language. (right now chances are pretty high it is de.srcml.language.Language.LANG_JAVA) > /** The filename of this SrcML unit */ > public final static String ATTR_FILENAME = "filename"; This is the filename which was given to the parser when the SrcML file was created (see de.srcml.parser.Parser.setFilename) and represents the name of the original source code file. > /** The author of this SrcML unit */ > public final static String ATTR_AUTHOR = "author"; This attribute isn't very well supported yet. Currently the java parser plugin sets the currently logged in username as author. Note that all these constants only define the name of the attribute in the <unit> tag. So for ATTR_FILENAME this means we get: <unit filename="..."> and you get the actual filename (the '...') using something like this: unit_instance.getAttribute(Unit.ATTR_FILENAME) -- Raiser, Frank Student @ University of Ulm (www.uni-ulm.de) You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time. (Bertrand Meyer) |