Methods Summary |
---|
private void | extractAttributes(java.io.BufferedReader reader, java.util.List attrList)
for(int i=0; i<50; i++){
String attrLine = reader.readLine().trim();
attrList.add(getAttributeFromLine(attrLine.trim()));
if(attrLine.endsWith(">"))
break;
}
|
private java.lang.String | getAttributeFromLine(java.lang.String attrLine)
StringTokenizer stk = new StringTokenizer(attrLine);
return stk.nextToken();
|
private java.lang.String | getAttributeLine(java.lang.String elementName, java.lang.String line)
if(line.startsWith("<!ATTLIST")){
String atLine = line.substring("<!ATTLIST".length()).trim();
StringTokenizer stk = new StringTokenizer(atLine);
if(stk.nextToken().equals(elementName))
return atLine.substring(elementName.length());
}
return null;
|
public java.util.List | getAttributeList(java.lang.String elementName)
if(attributeMap.get(elementName) != null)
return (List)attributeMap.get(elementName);
ArrayList attrList = new ArrayList();
try{
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
String readLine = null;
while((readLine = reader.readLine())!= null){
String attrLine = this.getAttributeLine(elementName, readLine);
if(attrLine == null)
continue;
if((attrLine.length() > 0) && (!attrLine.trim().equals("")))
attrList.add(this.getAttributeFromLine(attrLine));
this.extractAttributes(reader, attrList);
}
this.attributeMap.put(elementName, attrList);
}catch(Exception ex){
ex.printStackTrace();
}
return attrList;
|
public static com.sun.enterprise.tools.upgrade.transform.AttributeExtracter | getExtracter(java.lang.String fileName)
if(attrExtracter == null){
attrExtracter = new AttributeExtracter(fileName);
}
return attrExtracter;
|
public static void | main(java.lang.String[] args)
/* //AttributeExtracter extracter = new AttributeExtracter("c:\\temp\\sundomain.dtd");
AttributeExtracter extracter = AttributeExtracter.getExtracter("/home/paradhya/junk/sundomain.dtd");
List list = extracter.getAttributeList("http-listener");
System.out.println(list);
for(int i=0; i<list.size(); i++){
System.out.println(list.get(i));
}
*/
|