If not already created, a new <code>resource-bundle</code> element will be created and returned.
Otherwise, the first existing <code>resource-bundle</code> element will be returned.
@return the instance defined for the element <code>resource-bundle</code>
976738
public FacesConfigApplicationResourceBundleType<FacesConfigApplicationType<T>> getOrCreateResourceBundle()
   {
      List<Node> nodeList = childNode.get("resource-bundle");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigApplicationResourceBundleTypeImpl<FacesConfigApplicationType<T>>(this, "resource-bundle", childNode, nodeList.get(0));
      }
      return createResourceBundle();
   }
570650
public static ResourceUtil getInstance() {

    if (instance == null) {
      ResourceUtilImpl impl = null;
      synchronized (ResourceUtilImpl.class) {
        if (instance == null) {
          impl = new ResourceUtilImpl();
          impl.initialize();
          instance = impl;
        }
      }
    }
    return instance;
  }
185867
private ResourceBundleDefinition buildCustomBundleDefinition(String bundleName, boolean isChildBundle) {

		// Id for the bundle
		String bundleId = props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_ID);
		if (null == bundleId && !isChildBundle)
			throw new IllegalArgumentException(
					"No id defined for the bundle with name:" + bundleName + ". Please specify one in configuration. ");

		// Whether it's a composite or not
		boolean isComposite = Boolean
				.parseBoolean(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_COMPOSITE_FLAG, "false"));

		// Create definition and set its id
		ResourceBundleDefinition bundle = new ResourceBundleDefinition();
		bundle.setBundleId(bundleId);
		bundle.setBundleName(bundleName);
		bundle.setBundlePrefix(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_BUNDLE_PREFIX));

		// Whether it's global or not
		boolean isGlobal = Boolean
				.parseBoolean(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_GLOBAL_FLAG, "false"));
		bundle.setGlobal(isGlobal);

		// Set order if its a global bundle
		if (isGlobal) {
			int order = Integer.parseInt(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_ORDER, "0"));
			bundle.setInclusionOrder(order);
		}

		// Override bundle postprocessor
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_POSTPROCESSOR))
			bundle.setBundlePostProcessorKeys(
					props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_POSTPROCESSOR));

		// Override unitary postprocessor
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_FILE_POSTPROCESSOR))
			bundle.setUnitaryPostProcessorKeys(
					props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_FILE_POSTPROCESSOR));

		// Use only with debug mode on
		boolean isDebugOnly = Boolean
				.parseBoolean(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_DEBUGONLY, "false"));
		bundle.setDebugOnly(isDebugOnly);

		// Use only with debug mode off
		boolean isDebugNever = Boolean
				.parseBoolean(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_DEBUGNEVER, "false"));
		bundle.setDebugNever(isDebugNever);

		// Set conditional comment for IE, in case one is specified
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_IE_CONDITIONAL_EXPRESSION))
			bundle.setIeConditionalExpression(
					props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_IE_CONDITIONAL_EXPRESSION));

		// Sets the alternate URL for production mode.
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_PRODUCTION_ALT_URL))
			bundle.setAlternateProductionURL(
					props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_PRODUCTION_ALT_URL));

		boolean hasDebugURL = false;
		// Sets the debug URL for debug mode.
		if (null != props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_DEBUG_URL)) {
			bundle.setDebugURL(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_DEBUG_URL));
			hasDebugURL = true;
			if (StringUtils.isEmpty(bundle.getAlternateProductionURL())) {
				throw new IllegalArgumentException("The bundle '" + bundleName
						+ "', which use a static external resource in debug mode, must use an external resource in Production mode.\n"
						+ "Please check your configuration. ");
			}
			if (isComposite) {
				throw new IllegalArgumentException("The bundle '" + bundleName
						+ "', which use a static external resource in debug mode, can't be part of a composite bundle.\n"
						+ "Please check your configuration. ");
			}
			if (StringUtils.isNotEmpty(props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_MAPPINGS))) {
				throw new IllegalArgumentException("The bundle '" + bundleName
						+ "', which use a static external resource in debug mode, can't have a bundle mapping.\n"
						+ "Please check your configuration. ");
			}
		}

		if (isComposite) {
			String childBundlesProperty = props.getCustomBundleProperty(bundleName,
					BUNDLE_FACTORY_CUSTOM_COMPOSITE_NAMES);
			if (null == childBundlesProperty)
				throw new IllegalArgumentException(
						"No child bundle names were defined for the composite bundle with name:" + bundleName
								+ ". Please specify at least one in configuration. ");

			bundle.setComposite(true);

			// add children
			List<ResourceBundleDefinition> children = new ArrayList<>();
			StringTokenizer tk = new StringTokenizer(childBundlesProperty, JawrConstant.COMMA_SEPARATOR);
			while (tk.hasMoreTokens()) {
				ResourceBundleDefinition childDef = buildCustomBundleDefinition(tk.nextToken().trim(), true);
				childDef.setBundleId(props.getCustomBundleProperty(childDef.getBundleName(), BUNDLE_FACTORY_CUSTOM_ID));
				if (StringUtils.isEmpty(childDef.getDebugURL())) {
					children.add(childDef);
				} else {
					throw new IllegalArgumentException("The external bundle '" + childDef.getBundleName()
							+ "' can't be a child of the composite bundle '" + bundleName
							+ "'. Please check your configuration. ");

				}
			}
			bundle.setChildren(children);
		} else {
			String mappingsProperty = props.getCustomBundleProperty(bundleName, BUNDLE_FACTORY_CUSTOM_MAPPINGS);
			if (!hasDebugURL) {
				if (null == mappingsProperty) {
					throw new IllegalArgumentException("No mappings were defined for the bundle with name:" + bundleName
							+ ". Please specify at least one in configuration. ");
				} else {
					// Add the mappings
					List<String> mappings = new ArrayList<>();

					StringTokenizer tk = new StringTokenizer(mappingsProperty, JawrConstant.COMMA_SEPARATOR);
					while (tk.hasMoreTokens()) {
						String mapping = tk.nextToken().trim();
						mappings.add(mapping);
					}
					bundle.setMappings(mappings);
				}
			}
		}

		// dependencies
		List<String> dependencies = props.getCustomBundlePropertyAsList(bundleName, BUNDLE_FACTORY_CUSTOM_DEPENDENCIES);
		bundle.setDependencies(dependencies);

		return bundle;
	}
403921
public static <T> T newInstance(Class<T> clazz) {
		try {
			return clazz.newInstance();
		}
		catch (InstantiationException | IllegalAccessException e) {
			throw new ResourceException(String.format("couldn't create a new instance of %s", clazz));
		}
	}
879251
public BundlePathMapping build() {

		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Creating bundle path List for " + this.bundle.getId());
		}

		BundlePathMapping bundlePathMapping = new BundlePathMapping(this.bundle);
		bundlePathMapping.setPathMappings(strPathMappings);
		List<PathMapping> pathMappings = bundlePathMapping.getPathMappings();
		Map<String, VariantSet> variants = new TreeMap<>();

		if (pathMappings != null) {
			for (PathMapping pathMapping : pathMappings) {
				boolean isGeneratedPath = generatorRegistry.isPathGenerated(pathMapping.getPath());

				// Handle generated resources
				// path ends in /, the folder is included without subfolders
				if (pathMapping.isDirectory()) {
					addItemsFromDir(bundlePathMapping, pathMapping, false);
				}
				// path ends in /, the folder is included with all subfolders
				else if (pathMapping.isRecursive()) {
					addItemsFromDir(bundlePathMapping, pathMapping, true);
				} else if (pathMapping.getPath().endsWith(fileExtension)) {
					addPathMapping(bundlePathMapping, asPath(pathMapping.getPath(), isGeneratedPath));
				} else if (generatorRegistry.isPathGenerated(pathMapping.getPath())) {
					addPathMapping(bundlePathMapping, pathMapping.getPath());
				} else if (pathMapping.getPath().endsWith(LICENSES_FILENAME)) {
					bundlePathMapping.getLicensesPathList().add(asPath(pathMapping.getPath(), isGeneratedPath));
				} else {
					throw new BundlingProcessException("Wrong mapping [" + pathMapping + "] for bundle ["
							+ this.bundle.getName() + "]. Please check configuration. ");
				}

				if (isGeneratedPath) {
					// Add variants
					variants = VariantUtils.concatVariants(variants,
							generatorRegistry.getAvailableVariants(pathMapping.getPath()));
				}
			}
		}

		bundle.setVariants(variants);

		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Finished creating bundle path List for " + this.bundle.getId());
		}

		return bundlePathMapping;
	}
1275766
public static <F extends Fragment> FragmentBundler<F> create(F fragment) {
    return new FragmentBundler<F>(fragment);
  }
536891
public ElementType<AnnotationType<T>> getOrCreateElement()
   {
      List<Node> nodeList = childNode.get("element");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ElementTypeImpl<AnnotationType<T>>(this, "element", childNode, nodeList.get(0));
      }
      return createElement();
   }
1052039
public static VolleyFragment newInstance() {
		VolleyFragment fragment = new VolleyFragment();
		Bundle args = new Bundle();

		fragment.setArguments(args);
		return fragment;
	}
778693
public static ResourceManager get(String bundleName) {
        ResourceManager rm = (ResourceManager) nameToRM.get(bundleName);
        if (rm == null) {
            ResourceBundle rb = ResourceBundle.getBundle(bundleName);
            rm = new ResourceManager(rb);
            nameToRM.put(bundleName, rm);
        }
        return rm;
    }
405627
public Selector createSelector()
    {
        selectorSync.lock();
        try {
            Selector selector = Selector.open();
            assert (selector != null);
            selectors.add(selector);
            return selector;
        }
        catch (IOException e) {
            throw new ZError.IOException(e);
        }
        finally {
            selectorSync.unlock();
        }
    }
669713
public T nextElement() {
        T rc = null;
        if (null == this.myIterator) {
            rc = this.singleton;
            this.singleton = null;
        } else {
            rc = this.myIterator.next();
        }
        return rc;
    }
368211
public Embedded<Attributes<T>> getOrCreateEmbedded()
   {
      List<Node> nodeList = childNode.get("embedded");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new EmbeddedImpl<Attributes<T>>(this, "embedded", childNode, nodeList.get(0));
      }
      return createEmbedded();
   }
1200762
private CmsMessageBundleEditorTypes.BundleType initBundleType() {

        String resourceTypeName = OpenCms.getResourceManager().getResourceType(m_resource).getTypeName();
        return CmsMessageBundleEditorTypes.BundleType.toBundleType(resourceTypeName);
    }
334672
public List<FacesConfigApplicationResourceBundleType<FacesConfigApplicationType<T>>> getAllResourceBundle()
   {
      List<FacesConfigApplicationResourceBundleType<FacesConfigApplicationType<T>>> list = new ArrayList<FacesConfigApplicationResourceBundleType<FacesConfigApplicationType<T>>>();
      List<Node> nodeList = childNode.get("resource-bundle");
      for(Node node: nodeList)
      {
         FacesConfigApplicationResourceBundleType<FacesConfigApplicationType<T>>  type = new FacesConfigApplicationResourceBundleTypeImpl<FacesConfigApplicationType<T>>(this, "resource-bundle", childNode, node);
         list.add(type);
      }
      return list;
   }
948285
public static JusFragment newInstance() {
		JusFragment fragment = new JusFragment();
		Bundle args = new Bundle();
		fragment.setArguments(args);
		return fragment;
	}
378738
public Transient<EmbeddableAttributes<T>> getOrCreateTransient()
   {
      List<Node> nodeList = childNode.get("transient");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new TransientImpl<EmbeddableAttributes<T>>(this, "transient", childNode, nodeList.get(0));
      }
      return createTransient();
   }
1356150
public FacesConfigFacetType<FacesConfigRendererType<T>> getOrCreateFacet()
   {
      List<Node> nodeList = childNode.get("facet");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigFacetTypeImpl<FacesConfigRendererType<T>>(this, "facet", childNode, nodeList.get(0));
      }
      return createFacet();
   }