Re: [Jsdsi-users] extending jsdsi.Tag
Status: Pre-Alpha
Brought to you by:
sajma
From: Sameer A. <aj...@cs...> - 2004-04-27 12:58:11
|
Tag.toSexp() returns (tag <tag-material>), while Tag.toTagSexp() just returns <tag-material>. This just matters for when you write tags to a file or to the network (you should always use toSexp(), so that the receiver knows that it's getting a Tag). To construct application-specific tags, just use the Tag subclasses. For example, a tag like this: (tag (file (*set read write) (*prefix /home/ajmani))) Is constructed as: new SimpleTag("file", new ExprTag[] { new SetTag(new ExprTag[] { new StringTag("read"), new StringTag("write") }), new PrefixTag("/home/ajmani"); }; ).toSexp(); or parse the original string into an object: Tag myTag = (Tag)Obj.parseObj (new SexpInputString (new ByteArrayInputStream (Sexp.encodeString ("(tag (file (*set read write) (*prefix /home/ajmani)))") )).readSexp()); Sameer > Hi, > > I have a little question regarding jsdsi.Tag. I need to create an > application specific Tag and I was wondering if the abstract class Tag > is intended to be extended by external sw packages. > > If this is the case, the method Tag.toTagSexp() shouldn't it be > declared public or protected? In the latests stable version and > current CVS version is is package-private. And if this is not the > case, which is the best way to implement an application-specific tag? > > > thanks, > > Guillermo > > -- > --------------------------------------------------------------- > Guillermo Navarro (gna...@cc...) > Phone: +34 93 581 3577 > FAX: +34 93 581 3033 > Home: http://www.ccd.uab.es/~guille > Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) > Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain > --------------------------------------------------------------- > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For > a limited time only, get FREE Ground shipping on all orders of $35 or > more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Jsdsi-users mailing list > Jsd...@li... > https://lists.sourceforge.net/lists/listinfo/jsdsi-users http://ajmani.net |