📄 mbeandescriptorutil.java
字号:
/*
======================================================================
MBeanDescriptorUtil.java
Created by Claude Duguay
Copyright (c) 2005
======================================================================
*/
package com.claudeduguay.mbeans.model;
import java.io.*;
import org.jdom.*;
import com.claudeduguay.util.jdom.*;
public class MBeanDescriptorUtil
{
protected static DocumentStorage storage = new DocumentStorage();
public static String[] parseCommaSeparatedList(String text)
{
if (text == null)
{
return new String[0];
}
String[] list = text.split(",");
for (int i = 0; i < list.length; i++)
{
list[i] = list[i].trim();
}
return text.split(",");
}
public static String buildCommaSeparatedList(String[] list)
{
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < list.length; i++)
{
if (i > 0) buffer.append(", ");
buffer.append(list[i]);
}
return buffer.toString();
}
public static MBeanDescriptor read(File file)
throws Exception
{
return read(new FileInputStream(file));
}
public static MBeanDescriptor read(InputStream input)
throws Exception
{
Document doc = storage.read(input);
return new MBeanDescriptor(doc);
}
public static void write(MBeanDescriptor descriptor, OutputStream output) throws IOException, JDOMException
{
Document doc = descriptor.buildDocument();
storage.write(doc, output);
output.flush();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -