當前位置: 首頁>>代碼示例>>Java>>正文


Java Transcoder類代碼示例

本文整理匯總了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;
}
 
開發者ID:Banno,項目名稱:sbt-plantuml-plugin,代碼行數:11,代碼來源:PSystemDonors.java

示例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);
}
 
開發者ID:Banno,項目名稱:sbt-plantuml-plugin,代碼行數:11,代碼來源:SourceFileReader2.java

示例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;
}
 
開發者ID:Banno,項目名稱:sbt-plantuml-plugin,代碼行數:32,代碼來源:Run.java

示例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));
}
 
開發者ID:taichi,項目名稱:umlbot,代碼行數:28,代碼來源:UmlTest.java

示例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);
}
 
開發者ID:mar9000,項目名稱:plantuml,代碼行數:16,代碼來源:PSystemDonors.java

示例6: transcoder

import net.sourceforge.plantuml.code.Transcoder; //導入依賴的package包/類
static Transcoder transcoder() {
	return TranscoderUtil.getDefaultTranscoder();
}
 
開發者ID:taichi,項目名稱:umlbot,代碼行數:4,代碼來源:Uml.java


注:本文中的net.sourceforge.plantuml.code.Transcoder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。