1 8 package org.codehaus.aspectwerkz.definition; 9 10 import java.io.File ; 11 import java.net.MalformedURLException ; 12 import java.util.Set ; 13 import java.util.HashSet ; 14 15 22 public class DefinitionLoader { 23 26 public static final String DEFAULT_SYSTEM = "default"; 27 28 31 public static final String DEFINITION_FILE = System.getProperty("aspectwerkz.definition.file", null); 32 33 36 public static final String DEFAULT_DEFINITION_FILE_NAME = "aspectwerkz.xml"; 37 38 44 public static Set getDefaultDefinition(final ClassLoader loader) { 45 if (DEFINITION_FILE != null) { 46 File file = new File (DEFINITION_FILE); 47 if (file.canRead()) { 48 try { 49 return XmlParser.parseNoCache(loader, file.toURL()); 50 } catch (MalformedURLException e) { 51 System.err.println("<WARN> Cannot read " + DEFINITION_FILE); 52 e.printStackTrace(); 53 } 54 } else { 55 System.err.println("<WARN> Cannot read " + DEFINITION_FILE); 56 } 57 } 58 return new HashSet (); 59 } 60 } | Popular Tags |