本文整理匯總了Java中net.sourceforge.plantuml.code.Transcoder類的典型用法代碼示例。如果您正苦於以下問題:Java Transcoder類的具體用法?Java Transcoder怎麽用?Java Transcoder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Transcoder類屬於net.sourceforge.plantuml.code包,在下文中一共展示了Transcoder類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDonors
import net.sourceforge.plantuml.code.Transcoder; //導入依賴的package包/類
private List<String> getDonors() throws IOException {
final List<String> lines = new ArrayList<String>();
final Transcoder t = new TranscoderImpl();
final String s = t.decode(DONORS).replace('*', '.');
final StringTokenizer st = new StringTokenizer(s, "\n");
while (st.hasMoreTokens()) {
lines.add(st.nextToken());
}
return lines;
}
示例2: getEncodedUrl
import net.sourceforge.plantuml.code.Transcoder; //導入依賴的package包/類
public List<String> getEncodedUrl() throws IOException {
final List<String> result = new ArrayList<String>();
final Transcoder transcoder = TranscoderUtil.getDefaultTranscoder();
for (BlockUml blockUml : builder.getBlockUmls()) {
final String source = blockUml.getDiagram().getSource().getPlainString();
final String encoded = transcoder.encode(source);
result.add(encoded);
}
return Collections.unmodifiableList(result);
}
示例3: processArgs
import net.sourceforge.plantuml.code.Transcoder; //導入依賴的package包/類
private static boolean processArgs(Option option) throws IOException, InterruptedException {
if (option.isDecodeurl() == false && option.getNbThreads() > 0 && option.isCheckOnly() == false
&& OptionFlags.getInstance().isMetadata() == false) {
return multithread(option);
}
boolean errorGlobal = false;
for (String s : option.getResult()) {
if (option.isDecodeurl()) {
final Transcoder transcoder = TranscoderUtil.getDefaultTranscoder();
System.out.println("@startuml");
System.out.println(transcoder.decode(s));
System.out.println("@enduml");
} else {
final FileGroup group = new FileGroup(s, option.getExcludes(), option);
for (File f : group.getFiles()) {
try {
final boolean error = manageFileInternal(f, option);
if (error) {
errorGlobal = true;
}
if (error && option.isFailfastOrFailfast2()) {
return true;
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
return errorGlobal;
}
示例4: outgoing
import net.sourceforge.plantuml.code.Transcoder; //導入依賴的package包/類
@Test
public void outgoing() throws Exception {
Map<String, String> map = new HashMap<>();
map.put("token", TOKEN);
map.put("trigger_word", "@startuml");
String content = "hogehoge";
map.put("text", "@startuml\n" + content + "\[email protected]");
Request request = new MockUp<Request>() {
@Mock
Optional<String> form(String key) {
return Optional.ofNullable(map.get(key));
}
}.getMockInstance();
Response response = new MockUp<Response>() {
}.getMockInstance();
Object obj = this.target.outgoing(request, response);
assertNotNull(obj);
System.out.println(obj);
Msg msg = JsonFactory.fromJson(obj.toString(), Msg.class);
assertNotNull(msg.text);
assertTrue(msg.text.startsWith(HOST));
Transcoder t = Uml.transcoder();
String enc = t.encode(content);
assertTrue(msg.text.endsWith(enc));
}
示例5: getGraphicStrings
import net.sourceforge.plantuml.code.Transcoder; //導入依賴的package包/類
private GraphicStrings getGraphicStrings() throws IOException {
final List<String> lines = new ArrayList<String>();
lines.add("<b>Special thanks to our sponsors and donors !");
lines.add(" ");
final Transcoder t = new TranscoderImpl();
final String s = t.decode(DONORS).replace('*', '.');
final StringTokenizer st = new StringTokenizer(s, "\n");
while (st.hasMoreTokens()) {
lines.add(st.nextToken());
}
lines.add(" ");
final UFont font = new UFont("SansSerif", Font.PLAIN, 12);
return new GraphicStrings(lines, font, HtmlColorUtils.BLACK, HtmlColorUtils.WHITE,
UAntiAliasing.ANTI_ALIASING_ON, PSystemVersion.getPlantumlImage(), GraphicPosition.BACKGROUND_CORNER_BOTTOM_RIGHT);
}
示例6: transcoder
import net.sourceforge.plantuml.code.Transcoder; //導入依賴的package包/類
static Transcoder transcoder() {
return TranscoderUtil.getDefaultTranscoder();
}