1 18 package org.apache.beehive.netui.pageflow.internal; 19 20 import org.apache.beehive.netui.core.urls.MutableURI; 21 import org.apache.beehive.netui.core.urls.URIContext; 22 import org.apache.beehive.netui.util.config.ConfigUtil; 23 import org.apache.beehive.netui.util.config.bean.UrlConfig; 24 25 29 public final class URIContextFactory 30 { 31 32 33 private URIContextFactory() 34 { 35 } 36 37 46 public static final URIContext getInstance() 47 { 48 URIContext uriContext = MutableURI.getDefaultContext(); 49 UrlConfig urlConfig = ConfigUtil.getConfig().getUrlConfig(); 50 51 if ( urlConfig != null && urlConfig.isSetHtmlAmpEntity() ) 52 { 53 uriContext.setUseAmpEntity( urlConfig.getHtmlAmpEntity() ); 54 } 55 56 return uriContext; 57 } 58 59 69 public static final URIContext getInstance( boolean forXML ) 70 { 71 URIContext uriContext = null; 72 73 if ( forXML ) 74 { 75 uriContext = new URIContext(); 76 uriContext.setUseAmpEntity( true ); 77 } 78 else 79 { 80 uriContext = getInstance(); 81 } 82 83 return uriContext; 84 } 85 } 86 | Popular Tags |