<p>Get SrvI18n in lazy mode.</p>
@return SrvI18n - SrvI18n
@throws Exception - an exception
496736
public final SrvI18n lazyGetSrvI18n() throws Exception {
    String beanName = getSrvI18nName();
    SrvI18n srvI18n = (SrvI18n) this.beansMap.get(beanName);
    if (srvI18n == null) {
      srvI18n = new SrvI18n();
      srvI18n.setLogger(lazyGetLogger());
      srvI18n.initDefault();
      this.beansMap.put(beanName, srvI18n);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return srvI18n;
  }
1047567
public static BaseException translateException(Exception exception) {
        if (exception instanceof BaseException) {
            return (BaseException) exception;
        } else {
            for (SeedExceptionTranslator exceptionTranslator : exceptionTranslators) {
                if (exceptionTranslator.canTranslate(exception)) {
                    return exceptionTranslator.translate(exception);
                }
            }
            return SeedException.wrap(exception, CoreErrorCode.UNEXPECTED_EXCEPTION);
        }
    }
302618
public final CsvReader lazyGetCsvReader() throws Exception {
    String beanName = getCsvReaderName();
    CsvReader csvReader = (CsvReader) this.beansMap.get(beanName);
    if (csvReader == null) {
      csvReader = new CsvReader();
      this.beansMap.put(beanName, csvReader);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return csvReader;
  }
1329114
public Result call() throws Exception {
		final String sourceMethod = "call"; //$NON-NLS-1$
		IResourceVisitor visitor = new IResourceVisitor() {
			/* (non-Javadoc)
			 * @see com.ibm.jaggr.service.modules.ResourceVisitor#visitResource(com.ibm.jaggr.service.modules.Resource)
			 */
			@Override
			public boolean visitResource(Resource resource, String pathname) throws IOException {
				if (pathname == null) {
					pathname = ""; //$NON-NLS-1$
				}
				int idx = pathname.lastIndexOf("/"); //$NON-NLS-1$
				String resname = idx == -1 ? pathname : pathname.substring(idx+1);

				if (resource.isFolder()) {
					if (!resname.startsWith(".")) { //$NON-NLS-1$
						root.createOrGet(pathname, resource.getURI());
						return true;
					} else {
						return false;
					}
				}
				if (!resource.getURI().getPath().endsWith(".js")) { //$NON-NLS-1$
					// non-JavaScript resource
					idx = resname.lastIndexOf("."); //$NON-NLS-1$
					String extension = idx == -1 ? "" : resname.substring(idx+1); //$NON-NLS-1$
					if (nonJSExtensions.contains(extension)) {
						DepTreeNode node = root.createOrGet(pathname, resource.getURI());
						node.setDependencies(null, null,  null,  resource.lastModified(), resource.lastModified());
					}
					return false;
				}
				// strip off the .js extension
				if (pathname.endsWith(".js")) {  //$NON-NLS-1$
					pathname = pathname.substring(0, pathname.length()-3);
				}
				DepTreeNode node = (pathname.length() > 0) ? root.createOrGet(pathname, resource.getURI()) : root;
				DepTreeNode cachedNode = null;
				if (cached != null) {
					cachedNode = (pathname.length() > 0) ? cached.getDescendent(pathname) : cached;
				}
				if (cachedNode != null) {
					node.setDependencies(
							cachedNode.getDefineDepArray(),
							cachedNode.getRequireDepArray(),
							cachedNode.getDependentFeatures(),
							cachedNode.lastModified(), cachedNode.lastModifiedDep());
				}
				/*
				 * The path is for a javascript module. Check the timestamp for the
				 * node against the timestamp for the file object to see if the file
				 * has changed and we need to re-parse it.
				 */
				if (node.lastModified() != resource.lastModified()) {
					// File has changed, or is new. Submit an async parser job.
					parserCs.submit(new DepParser(node, resource.newResource(aggregator), compilerOptionsMap));
					parserCount.incrementAndGet();
				}
				return true;
			}
		};

		/*
		 * Process the path. The treeWalker method will queue files
		 * to the parser completion service to parse javascript
		 * files in order to read the require list from the AMD
		 * define() function, and increments parserCount for each
		 * file queued.
		 */
		IResource resource = aggregator.newResource(uri);
		if (resource.exists()) {
			resource.walkTree(visitor);
		}
		/*
		 * Call treeWalker again, this time to add the javascript
		 * module with the same pathname, if it exists.
		 */
		String name = uri.getPath();
		if (!name.endsWith(".js")) { //$NON-NLS-1$
			if (name.endsWith("/")) { //$NON-NLS-1$
				name = name.substring(0, name.length()-1);
			}
			int idx = name.lastIndexOf("/"); //$NON-NLS-1$
			if (idx != -1) {
				name = name.substring(idx + 1);
			}
			name += ".js"; //$NON-NLS-1$

			resource = aggregator.newResource(
					uri.resolve((uri.getPath().endsWith("/") ? "../" : "./") + name)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
			if (resource.exists()) {
				visitor.visitResource(resource.asVisitorResource(), ""); //$NON-NLS-1$
			}
		}
		// Record the count of files queue
		int totalCount = parserCount.get();

		// Pull the completed parser tasks from the completion queue
		// until all files have been parsed
		while (parserCount.decrementAndGet() >= 0) {
			try {
				SignalUtil.take(parserCs, sourceClass, sourceMethod).get();
			} catch (Exception e) {
				if (log.isLoggable(Level.SEVERE))
					log.logp(Level.SEVERE, sourceClass, sourceMethod, e.getMessage(), e);
			}
		}

		// Return the buildReader
		return new Result(uri.toString(), totalCount);
	}
816473
public static Locale getLocale() {
		String tag = Configuration.get("locale");
		if (tag == null) {
			return Locale.ROOT;
		} else {
			String[] splittedTag = tag.split("_", MAX_LOCALE_ARGUMENTS);
			if (splittedTag.length == 1) {
				return new Locale(splittedTag[0]);
			} else if (splittedTag.length == 2) {
				return new Locale(splittedTag[0], splittedTag[1]);
			} else {
				return new Locale(splittedTag[0], splittedTag[1], splittedTag[2]);
			}
		}
	}
969286
public final FctConvertersToFromString
    lazyGetFctConvertersToFromString() throws Exception {
    String beanName = getFctConvertersToFromStringName();
    FctConvertersToFromString fctConvertersToFromString =
      (FctConvertersToFromString) this.beansMap.get(beanName);
    if (fctConvertersToFromString == null) {
      fctConvertersToFromString = new FctConvertersToFromString();
      fctConvertersToFromString.setUtlReflection(lazyGetUtlReflection());
      fctConvertersToFromString
        .setFieldsRapiHolder(lazyGetHolderRapiFields());
      fctConvertersToFromString
        .setGettersRapiHolder(lazyGetHolderRapiGetters());
      fctConvertersToFromString
        .setSettersRapiHolder(lazyGetHolderRapiSetters());
      HlFlCnNm hldFieldsCnvTfsNames = lazyGetHldFieldsCnvTfsNames();
      fctConvertersToFromString
        .setFieldConverterNamesHolder(hldFieldsCnvTfsNames);
      HolderRapiFields holderRapiFields = lazyGetHolderRapiFields();
      ASrvOrm<RS> srvOrm = lazyGetSrvOrm();
      // prepare for setting fieldFromToStringConverter
      // according Specification Beige-WEB interface version #2:
      //TODO move it as lazy into factory!!!
      for (Class<?> clazz : hldFieldsCnvTfsNames
        .getMngSettings().getClasses()) {
        for (String fieldNm : hldFieldsCnvTfsNames.getMngSettings()
          .lazFldsSts(clazz).keySet()) {
          String cnNm = hldFieldsCnvTfsNames.getFor(clazz, fieldNm);
          if (cnNm != null && (cnNm.startsWith(CnvTfsEnum.class.getSimpleName())
              || cnNm.startsWith(CnvTfsObject.class.getSimpleName())
                || cnNm.startsWith(CnvTfsHasId.class.getSimpleName()))) {
            Field field = holderRapiFields.getFor(clazz, fieldNm);
            Class ngClass = field.getType();
            //cnNm += ngClass.getSimpleName();
            if (cnNm.startsWith(CnvTfsEnum.class.getSimpleName())) {
              fctConvertersToFromString
                .getEnumsClasses().add(ngClass);
            } else if (cnNm.startsWith(CnvTfsObject.class
              .getSimpleName())) {
              fctConvertersToFromString
                .getCompositeClasses().add(ngClass);
            } else if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName())) {
              TableSql tableSql = srvOrm.getTablesMap()
                .get(ngClass.getSimpleName());
              if (tableSql == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "Foreign entity table not found for field/class: " + field.getName()
          + "/" + clazz);
              }
              if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName() + "Long")) {
                fctConvertersToFromString.getHasLongIdMap()
                  .put(ngClass, tableSql.getIdFieldName());
              } else if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName() + "Integer")) {
                fctConvertersToFromString.getHasIntegerIdMap()
                  .put(ngClass, tableSql.getIdFieldName());
              } else if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName() + "String")) {
                fctConvertersToFromString.getHasStringIdMap()
                  .put(ngClass, tableSql.getIdFieldName());
              } else if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName() + "Composite")) {
                fctConvertersToFromString.getHasCompositeIdMap()
                  .put(ngClass, tableSql.getIdFieldName());
              }
            }
          }
        }
      }
      hldFieldsCnvTfsNames.getMngSettings().setFieldsSettings(null);
      hldFieldsCnvTfsNames.getMngSettings().setClassesSettings(null);
      this.beansMap.put(beanName, fctConvertersToFromString);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return fctConvertersToFromString;
  }
247638
public final SrvPage lazyGetSrvPage() throws Exception {
    String beanName = getSrvPageName();
    SrvPage srvPage = (SrvPage) this.beansMap.get(beanName);
    if (srvPage == null) {
      srvPage = new SrvPage();
      this.beansMap.put(beanName, srvPage);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return srvPage;
  }
1107442
@Override
    public Locale getLocale() {
        if (null == this.locales) {
            this.locales = connection.getEncodingUtils().getLocales(this.request.getHeader("Accept-Language"));
        }
        if (this.locales.isEmpty()) {
            return null;
        }
        return this.locales.get(0);
    }
685871
@Override
    public String getLocalizedMessage() {

        if (m_exceptions.isEmpty()) {
            return null;
        }
        StringBuffer result = new StringBuffer(128);
        Iterator<CmsException> it = m_exceptions.iterator();
        while (it.hasNext()) {
            CmsException ex = it.next();
            result.append(ex.getLocalizedMessage());
            if (it.hasNext()) {
                result.append('\n');
            }
        }
        return result.toString();
    }
493260
protected function getLocale()
    {
        if (!$this->hasArgument('forceLocale')) {
            return null;
        }
        $forceLocale = $this->arguments['forceLocale'];
        $useLocale = null;
        if ($forceLocale instanceof I18n\Locale) {
            $useLocale = $forceLocale;
        } elseif (is_string($forceLocale)) {
            try {
                $useLocale = new I18n\Locale($forceLocale);
            } catch (I18n\Exception $exception) {
                throw new InvalidVariableException('"' . $forceLocale . '" is not a valid locale identifier.', 1342610148, $exception);
            }
        } elseif ($forceLocale === true) {
            $useLocale = $this->localizationService->getConfiguration()->getCurrentLocale();
        }

        return $useLocale;
    }
957104
protected final CnvTfsLong
    lazyGetCnvTfsLong() throws Exception {
    CnvTfsLong convrt = (CnvTfsLong) convertersMap
      .get(CnvTfsLong.class.getSimpleName());
    if (convrt == null) {
      convrt = new CnvTfsLong();
      this.convertersMap.put(CnvTfsLong.class.getSimpleName(), convrt);
    }
    return convrt;
  }
1367008
public function getTranslator() {
        if (!$this->_translator) {
            if ($this->translator) {
                $class = $this->translator;
                $this->_translator = $class::get();
                if (!is_a($this->_translator, '\\mpf\\interfaces\\TranslatorInterface')) {
                    $this->_translator = null;
                    $this->translator = '';
                    throw new Exception("Invalid translator $class!  Must implement \\mpf\\interfaces\\TranslatorInterface!");
                }
            }
        }
        return $this->_translator;
    }
619354
public String getShortMessage(Locale locale) {
		String message;
		message = translate(Integer.toString(exceptionCode), locale);
		if (message != null && msgParameters != null && msgParameters.length > 0) {
			for (int i = 0; i < msgParameters.length; i++) {
				boolean isIncluded = false;
				String needTranslationParam = "$${" + i + "}";
				if (message.contains(needTranslationParam)) {
					String translation = translate(msgParameters[i], locale);
					if (null == translation && null != msgParameters[i]) {
						translation = msgParameters[i].toString();
					}
					if (null == translation) {
						translation = "[null]";
					}
					message = message.replace(needTranslationParam, translation);
					isIncluded = true;
				}
				String verbatimParam = "${" + i + "}";
				String rs = null == msgParameters[i] ? "[null]" : msgParameters[i].toString();
				if (message.contains(verbatimParam)) {
					message = message.replace(verbatimParam, rs);
					isIncluded = true;
				}
				if (!isIncluded) {
					message = message + " (" + rs + ")"; // NOSONAR replace/contains makes StringBuilder use difficult
				}
			}
		}
		return message;
	}
490024
protected final PrcRefreshHndlI18n
    lazyGetPrcRefreshHndlI18n(
      final Map<String, Object> pAddParam) throws Exception {
    PrcRefreshHndlI18n proc = (PrcRefreshHndlI18n) this.processorsMap
      .get(PrcRefreshHndlI18n.class.getSimpleName());
    if (proc == null) {
      proc = new PrcRefreshHndlI18n();
      proc.setI18nRequestHandler(this.i18nRequestHandler);
      //assigning fully initialized object:
      this.processorsMap
        .put(PrcRefreshHndlI18n.class.getSimpleName(), proc);
    }
    return proc;
  }
1308867
public final HlpEntitiesPage<RS> lazyGetHlpEntitiesPage() throws Exception {
    String beanName = getHlpEntitiesPageName();
    @SuppressWarnings("unchecked")
    HlpEntitiesPage<RS> hlpEntitiesPage =
      (HlpEntitiesPage<RS>) this.beansMap.get(beanName);
    if (hlpEntitiesPage == null) {
      hlpEntitiesPage = new HlpEntitiesPage<RS>();
      hlpEntitiesPage.setFieldsRapiHolder(lazyGetHolderRapiFields());
      hlpEntitiesPage.setSrvI18n(lazyGetSrvI18n());
      hlpEntitiesPage.setSrvOrm(lazyGetSrvOrm());
      hlpEntitiesPage.setSrvPage(lazyGetSrvPage());
      hlpEntitiesPage.setSrvDate(lazyGetSrvDate());
      hlpEntitiesPage.setLogger(lazyGetLogger());
      hlpEntitiesPage.setMngUvdSettings(lazyGetMngUvdSettings());
      hlpEntitiesPage
        .setConvertersFieldsFatory(lazyGetFctConvertersToFromString());
      hlpEntitiesPage
        .setFieldConverterNamesHolder(lazyGetHldFieldsCnvTfsNames());
      this.beansMap.put(beanName, hlpEntitiesPage);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return hlpEntitiesPage;
  }
1051460
public int doEndTag() throws JspException
    {

        String key = null;
        LocalizationContext locCtxt = null;

        // determine the message key by...
        if (keySpecified)
        {
            // ... reading 'key' attribute
            key = keyAttrValue;
        } else
        {
            // ... retrieving and trimming our body
            if (bodyContent != null && bodyContent.getString() != null)
                key = bodyContent.getString().trim();
        }

        if ((key == null) || key.equals(""))
        {
            try
            {
                pageContext.getOut().print("??????");
            } catch (IOException ioe)
            {
                throw new JspTagException(ioe.toString(), ioe);
            }
            return EVAL_PAGE;
        }

        String prefix = null;
        if (!bundleSpecified)
        {
            Tag t = findAncestorWithClass(this, BundleSupport.class);
            if (t != null)
            {
                // use resource bundle from parent <bundle> tag
                BundleSupport parent = (BundleSupport) t;
                locCtxt = parent.getLocalizationContext();
                prefix = parent.getPrefix();
            } else
            {
                locCtxt = BundleSupport.getLocalizationContext(pageContext);
            }
        } else
        {
            // localization context taken from 'bundle' attribute
            locCtxt = bundleAttrValue;
            if (locCtxt.getLocale() != null)
            {
                SetLocaleSupport.setResponseLocale(pageContext, locCtxt.getLocale());
            }
        }

        String message = UNDEFINED_KEY + key + UNDEFINED_KEY;
        if (locCtxt != null)
        {
            ResourceBundle bundle = locCtxt.getResourceBundle();
            if (bundle != null)
            {
                try
                {
                    // prepend 'prefix' attribute from parent bundle
                    if (prefix != null)
                        key = prefix + key;
                    message = bundle.getString(key);
                    // Perform parametric replacement if required
                    if (!params.isEmpty())
                    {
                        Object[] messageArgs = params.toArray();
                        Locale locale;
                        if (locCtxt.getLocale() != null)
                        {
                            locale = locCtxt.getLocale();
                        } else
                        {
                            // For consistency with the <fmt:formatXXX> actions,
                            // we try to get a locale that matches the user's
                            // preferences
                            // as well as the locales supported by 'date' and
                            // 'number'.
                            // System.out.println("LOCALE-LESS LOCCTXT: GETTING FORMATTING LOCALE");
                            locale = SetLocaleSupport.getFormattingLocale(pageContext);
                            // System.out.println("LOCALE: " + locale);
                        }
                        MessageFormat formatter = (locale != null) ? Humanize.messageFormat(message, locale)
                                : Humanize.messageFormat(message);
                        message = formatter.format(messageArgs);
                    }
                } catch (MissingResourceException mre)
                {
                    message = UNDEFINED_KEY + key + UNDEFINED_KEY;
                }
            }
        }

        if (var != null)
        {
            pageContext.setAttribute(var, message, scope);
        } else
        {
            try
            {
                pageContext.getOut().print(message);
            } catch (IOException ioe)
            {
                throw new JspTagException(ioe.toString(), ioe);
            }
        }

        return EVAL_PAGE;
    }
1116074
public static Set<String> getSupportedLocales() throws IOException {
		Set<String> locales = getAvailableFiles("locales-", "en-US", "xml");
		try {
			List<String> baseLocales = getRunner().callMethod(
					"getBaseLocales", List.class);
			locales.addAll(baseLocales);
		} catch (ScriptRunnerException e) {
			//ignore. don't add base locales
		}
		return locales;
	}