1 22 package org.jboss.services.xml; 23 24 import java.util.Map ; 25 import java.util.Iterator ; 26 import java.util.Properties ; 27 28 import org.jboss.util.xml.JBossEntityResolver; 29 30 39 public class JBossEntityResolverMgr 40 implements JBossEntityResolverMgrMBean 41 { 42 43 public boolean isWarnOnNonFileURLs() 44 { 45 return JBossEntityResolver.isWarnOnNonFileURLs(); 46 } 47 public void setWarnOnNonFileURLs(boolean flag) 48 { 49 JBossEntityResolver.setWarnOnNonFileURLs(flag); 50 } 51 52 public Properties getEntityMap() 53 { 54 Map map = JBossEntityResolver.getEntityMap(); 55 Properties props = new Properties (); 56 Iterator entries = map.entrySet().iterator(); 57 while( entries.hasNext() ) 58 { 59 Map.Entry entry = (Map.Entry ) entries.next(); 60 String key = (String ) entry.getKey(); 61 String value = (String ) entry.getValue(); 62 props.setProperty(key, value); 63 } 64 return props; 65 } 66 public void setEntityMap(Properties map) 67 { 68 Iterator entries = map.entrySet().iterator(); 69 while( entries.hasNext() ) 70 { 71 Map.Entry entry = (Map.Entry ) entries.next(); 72 String key = (String ) entry.getKey(); 73 String value = (String ) entry.getValue(); 74 JBossEntityResolver.registerEntity(key, value); 75 } 76 } 77 78 public void registerEntity(String id, String file) 79 { 80 JBossEntityResolver.registerEntity(id, file); 81 } 82 } 83 | Popular Tags |