[jdom-interest] questions about org.jdom.ProcessingInstruction

Jason Hunter jhunter at collab.net
Tue Sep 12 15:47:26 PDT 2000

> - The "data" portion of a ProcessingInstruction seems to be stored as both a
> String and a Map; is this, in fact, the case?


> - If so, what is the rationale for this, as opposed to just using one or the
> other?

Because technically it's a literal String with whitespace and all, but
people most often use it as a map.

> - Would a Map alone suffice to store all the possible "data payloads" a
> processing instruction could legally have?

Nope, you'd lose the option for literal formatting.  When you pass in a
Map you're explicitly not caring about formatting.

> - There is a constructor that takes a Map and an internal Map already, but there
> doesn't seem to be any way to get a Map back out from a ProcessingInstruction;
> is this so?

The getValue() provides access to the Map.

> - If yes, what would be the implications of adding a public Map getDataMap()
> method to ProcessingInstruction?  

It'd be annoying because to follow the JDOM style it'd have to be
mutable, and I'd rather not get into that.

> If there weren't also a shadow data String,

But there needs to be.

(Sorry for being terse, tons to do today.)


More information about the jdom-interest mailing list