こんにちは、解決できない問題があります。A は jar マニフェストから String の形式でパッケージをエクスポートしました。キーがパッケージの名前で、残りの情報がvalueの Map に入れたいと思います。それは簡単なことだと言うでしょうが、私が何をしたいのかを正確に示しましょう。私は文字列を持っています。
aQute.bnd.annotation;version="1.43.1",aQute.bnd.annotati
on.component;version="1.43.1",aQute.bnd.annotation.metatype;version="1.
43.1",aQute.bnd.ant;uses:="aQute.service.reporter,org.apache.tools.ant,
org.apache.tools.ant.taskdefs,org.apache.tools.ant.types";version="0.0.
0",aQute.bnd.build;version="2.1.0";uses:="aQute.bnd.maven.support,aQute
.bnd.osgi,aQute.bnd.service,aQute.bnd.service.action,aQute.bnd.version,
aQute.service.reporter",aQute.bnd.build.model;version="2.3";uses:="aQut
e.bnd.build.model.clauses,aQute.bnd.properties,aQute.bnd.version,org.os
gi.resource",aQute.bnd.build.model.clauses;version=2;uses:="aQute.bnd.h
eader",aQute.bnd.build.model.conversions;uses:="aQute.bnd.build.model,a
Qute.bnd.build.model.clauses,aQute.bnd.header,aQute.libg.tuple,org.osgi
.resource";version="0.0.0"
キーのコンマ(、)で分割すると、ピースが間違ってしまいます。
aQute.bnd.ant;uses:="aQute.service.reporter,org.apache.tools.ant,
org.apache.tools.ant.taskdefs,org.apache.tools.ant.types";version="0.0.
0"
uses句では、依存パックの名前もカンマで区切ります。したがって、上記の行は次のように出力マップに含まれている必要があります。
Key: aQute.bnd.ant
Value: uses:="aQute.service.reporter,org.apache.tools.ant,
org.apache.tools.ant.taskdefs,org.apache.tools.ant.types";version="0.0.
0"
それでは、私の仕事をするためにどの文字列メソッドまたは正規表現を使用すればよいでしょうか?