当前位置: 首页>>代码示例>>Java>>正文


Java Objects.empty方法代码示例

本文整理汇总了Java中net.meisen.general.genmisc.types.Objects.empty方法的典型用法代码示例。如果您正苦于以下问题:Java Objects.empty方法的具体用法?Java Objects.empty怎么用?Java Objects.empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.meisen.general.genmisc.types.Objects的用法示例。


在下文中一共展示了Objects.empty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMember

import net.meisen.general.genmisc.types.Objects; //导入方法依赖的package包/类
/**
 * Gets the member defined within the {@code SelectorMemberContext}.
 * 
 * @param selMember
 *            the context to read the member from
 * 
 * @return the {@code DimensionSelector} defined by the context
 */
protected DimensionSelector getMember(final SelectorMemberContext selMember) {
	final int childrenSize = selMember.getChildCount();

	if (childrenSize != 5) {
		throw new ForwardedRuntimeException(QueryParsingException.class,
				1022, selMember.getText());
	}

	final String dimId = selMember.getChild(TerminalNode.class, 0)
			.getText();
	final String hierarchyId = selMember.getChild(TerminalNode.class, 2)
			.getText();
	final String levelId = selMember.getChild(TerminalNode.class, 4)
			.getText();

	// make sure none is empty
	if (Objects.empty(dimId) || Objects.empty(hierarchyId)
			|| Objects.empty(levelId)) {
		throw new ForwardedRuntimeException(QueryParsingException.class,
				1022, selMember.getText());
	}

	return new DimensionSelector(dimId, hierarchyId, levelId);
}
 
开发者ID:pmeisen,项目名称:dis-timeintervaldataanalyzer,代码行数:33,代码来源:QueryGenerator.java

示例2: setXsltTransformer

import net.meisen.general.genmisc.types.Objects; //导入方法依赖的package包/类
/**
 * This method is used to set the transformer to be used for the
 * transformation. It reads the transformer from the passed
 * <code>xsltClassPath</code>.
 * 
 * @param xsltClassPath
 *            the <code>String</code> pointing to the XSLT on the classpath
 * 
 * @throws InvalidXsltException
 *             if the XSLT cannot be found on the classpath, the XSLT is
 *             invalid, ...
 */
public void setXsltTransformer(final String xsltClassPath)
		throws InvalidXsltException {

	if (Objects.empty(xsltClassPath)) {
		setXsltTransformer((InputStream) null);
	} else {
		try {
			setXsltTransformer(new ClassPathResource(xsltClassPath)
					.getInputStream());
		} catch (final IOException e) {
			throw new InvalidXsltException(
					"The xslt could not be read from the classpath '"
							+ xsltClassPath + "'", e);
		}
	}
}
 
开发者ID:pmeisen,项目名称:gen-sbconfigurator,代码行数:29,代码来源:DefaultXsltTransformer.java

示例3: setXsltTransformer

import net.meisen.general.genmisc.types.Objects; //导入方法依赖的package包/类
/**
 * This method is used to set the transformer to be used for the
 * transformation. It reads the transformer from the passed
 * <code>xsltClassPath</code>.
 * 
 * @param xsltClassPath
 *            the <code>String</code> pointing to the XSLT on the classpath
 * 
 * @throws InvalidXsltException
 *             if the XSLT cannot be found on the classpath, the XSLT is
 *             invalid, ...
 */
public void setXsltTransformer(final String xsltClassPath)
		throws InvalidXsltException {
	if (Objects.empty(xsltClassPath)) {
		setXsltTransformer((InputStream) null);
	} else {
		try {
			setXsltTransformer(new ClassPathResource(xsltClassPath)
					.getInputStream());
		} catch (final IOException e) {
			throw new InvalidXsltException(
					"The xslt stream could not be read.", e);
		}
	}
}
 
开发者ID:pmeisen,项目名称:gen-sbconfigurator,代码行数:27,代码来源:DefaultLoaderDefinition.java

示例4: registerModuleBeanDefinition

import net.meisen.general.genmisc.types.Objects; //导入方法依赖的package包/类
/**
 * Registers a single <code>beanDefinition</code> to be loaded for the
 * <code>Configuration</code>.
 * 
 * @param id
 *            the <code>beanDefinition</code>'s identifier
 * @param beanDefinition
 *            the <code>BeanDefinition</code> instance to be registered
 * @param loaderId
 *            the loader's identifier for logging purposes
 */
protected void registerModuleBeanDefinition(final String id,
		final BeanDefinition beanDefinition, final String loaderId) {

	// register the module
	if (Objects.empty(beanDefinition) || Objects.empty(id)) {
		throw new IllegalArgumentException("The id ('" + id
				+ "') or the beanDefinition cannot be null.");
	}

	// in the case of an anonymous id we should never override
	if (isAnonymousId(id) && moduleDefinitions.containsKey(id)) {
		moduleDefinitions.put(UUID.randomUUID().toString() + "_" + id,
				beanDefinition);
	} else if (moduleDefinitions.put(id, beanDefinition) != null) {
		if (LOG.isWarnEnabled()) {
			LOG.warn("Overloading the moduleDefinition '" + id
					+ "' with the one from the loaderDefinition '"
					+ loaderId + "'");
		}
	} else {
		if (LOG.isDebugEnabled()) {
			LOG.debug("Added the moduleDefinition '" + id
					+ "' from loaderDefinition '" + loaderId + "'");
		}
	}
}
 
开发者ID:pmeisen,项目名称:gen-sbconfigurator,代码行数:38,代码来源:DefaultConfiguration.java

示例5: setLocationSelectors

import net.meisen.general.genmisc.types.Objects; //导入方法依赖的package包/类
/**
 * Defines several selectors for <code>this</code> instance. All other
 * pre-defined selectors are removed.
 * 
 * @param locationSelectors
 *            the array of selectors to use
 */
public void setLocationSelectors(final String[] locationSelectors) {

	// nothing to do if we don't have anything defined
	if (locationSelectors == null || locationSelectors.length < 1) {
		return;
	}

	// create a list of all the locations
	final Set<Resource> locations = new LinkedHashSet<Resource>();

	// get through each locationSelector
	for (final String locationSelector : locationSelectors) {

		// check the locationSelector
		if (Objects.empty(locationSelector)) {
			if (LOG.isWarnEnabled()) {
				LOG.warn("The specified locationSelector is empty and therefore cannot be resolved");
			}
			continue;
		}

		// resolve the selector
		final Collection<ResourceInfo> resInfos = net.meisen.general.genmisc.resources.Resource
				.getResources(locationSelector, true, false);
		if (LOG.isTraceEnabled()) {
			LOG.trace("Found '" + resInfos.size()
					+ "' properties to be loaded by the selector: '"
					+ locationSelector + "'"
					+ (resInfos.size() > 0 ? " (" + resInfos + ")" : ""));
		}

		// get all the found resource infos
		for (final ResourceInfo resInfo : resInfos) {

			// make sure we have a file
			if (!resInfo.isFile()) {
				if (LOG.isInfoEnabled()) {
					LOG.info("Skipping resource '"
							+ resInfo
							+ "', it was selected by the propertySelector, but isn't a file.");
				}
				continue;
			}

			// get the InputStream
			final InputStream resIo = net.meisen.general.genmisc.resources.Resource
					.getResourceAsStream(resInfo);

			// transform the stream to a byte-array
			try {
				final byte[] byteArray = Streams
						.copyStreamToByteArray(resIo);
				locations.add(new ByteArrayResource(byteArray));
			} catch (final IOException e) {
				if (LOG.isWarnEnabled()) {
					LOG.warn("Skipping resource '" + resInfo
							+ "', unable to access the resource.", e);
				}
			}
		}
	}

	// set the loaded locations
	setLocations(locations.toArray(new Resource[] {}));
}
 
开发者ID:pmeisen,项目名称:gen-sbconfigurator,代码行数:73,代码来源:SpringPropertyHolder.java


注:本文中的net.meisen.general.genmisc.types.Objects.empty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。