Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import jp.co.vinculumjapan.stc.log.StcLog;
import jp.co.vinculumjapan.stc.util.properties.StcLibProperty;
import org.apache.log4j.Category;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class BatchConfigXml
{
private static Map BatchXmlMap = new HashMap();
static final String BATCH_DEFINE_FILENAME = "BatchConfig.xml";
public static BatchBean get(String batchId)
throws IllegalArgumentException, IllegalStateException
{
BatchBean bean = null;
if (BatchXmlMap.isEmpty()) {
initBatchXml(StcLibProperty.propertiesDir);
}
if (BatchXmlMap.containsKey(batchId)) {
bean = (BatchBean)BatchXmlMap.get(batchId);
}
return bean;
}
private static void readXML(String path)
throws IllegalArgumentException
{
Map ret = new HashMap();
try
{
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbfactory.newDocumentBuilder();
Document doc = builder.parse(new File(path + "/" + "BatchConfig.xml"));
Element root = doc.getDocumentElement();
NodeList batchs = root.getElementsByTagName("Batch");
for (int i = 0; i < batchs.getLength(); i++)
{
Node batch = batchs.item(i);
NamedNodeMap map = batch.getAttributes();
String batchid = map.getNamedItem("id").getNodeValue();
BatchBean bean = new BatchBean();
if (ret.containsKey(batchid)) {
throw new RuntimeException("�d������ID���o�b�`���`�t�@�C��������������" + batchid);
}
ret.put(batchid, bean);
String classname = map.getNamedItem("class").getNodeValue();
bean.setClassname(classname);
Node node = map.getNamedItem("name");
if (node != null) {
bean.setName(node.getNodeValue());
}
if (map.getNamedItem("beanclass") != null)
{
String beanname = map.getNamedItem("beanclass").getNodeValue();
bean.setBeanname(beanname);
NodeList parameters = ((Element)batch).getElementsByTagName("Parameter");
Map paraMap = new HashMap();
for (int j = 0; j < parameters.getLength(); j++)
{
Node parameter = parameters.item(j);
NamedNodeMap mp = parameter.getAttributes();
String paramname = "";
if (mp.getNamedItem("name") != null) {
paramname = mp.getNamedItem("name").getNodeValue();
} else {
paramname = "PARAMETER";
}
String paramValue = parameter.getFirstChild().getNodeValue().trim();
paraMap.put(paramname, paramValue);
}
bean.setParameters(paraMap);
}
}
}
catch (Exception e)
{
e.printStackTrace();
throw new IllegalArgumentException("BatchConfig.xml�������������s���������B" + e.getMessage());
}
BatchXmlMap = ret;
}
public static void initBatchXml(String path)
throws IllegalArgumentException
{
synchronized (BatchXmlMap)
{
if (BatchXmlMap.isEmpty())
{
StcLog.getInstance().getLog().info("BatchConfig.xml���������������B");
readXML(path);
}
}
}
}
![]() |
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team