List of usage examples for org.springframework.util Assert hasText
@Deprecated public static void hasText(@Nullable String text)
From source file:com.azaptree.services.command.impl.CommandServiceImpl.java
@Override public CommandCatalog getCommandCatalog(final String catalogName) { Assert.hasText(catalogName); return commandCatalogs.get(catalogName); }
From source file:org.brushingbits.jnap.persistence.hibernate.DynaQueryBuilder.java
/** * /*from w w w . jav a 2s . c o m*/ * @param session * @param entityName * @param dynaQuery * @param queryParams */ DynaQueryBuilder(Session session, String entityName, String dynaQuery, Object... queryParams) { Assert.notNull(session); Assert.hasText(entityName); Assert.hasText(dynaQuery); this.session = session; this.entityName = entityName; this.dynaQuery = dynaQuery; this.queryParams = queryParams == null ? ArrayUtils.EMPTY_OBJECT_ARRAY : queryParams; this.entityMetadata = this.session.getSessionFactory().getClassMetadata(this.entityName); buildCriterionBuilderStrategy(); }
From source file:org.jnap.core.persistence.hibernate.DynaQueryBuilder.java
/** * /*from w w w . j a v a2 s. c o m*/ * @param session * @param entityName * @param dynaQuery * @param queryParams */ public DynaQueryBuilder(Session session, String entityName, String dynaQuery, Object... queryParams) { Assert.notNull(session); Assert.hasText(entityName); Assert.hasText(dynaQuery); this.session = session; this.entityName = entityName; this.dynaQuery = dynaQuery; this.queryParams = queryParams == null ? ArrayUtils.EMPTY_OBJECT_ARRAY : queryParams; this.entityMetadata = this.session.getSessionFactory().getClassMetadata(this.entityName); buildCriterionBuilderStrategy(); }
From source file:com.streamreduce.core.dao.UserDAO.java
public User findByAuthToken(String authenticationToken) { Assert.hasText(authenticationToken); APIAuthenticationToken authToken = new APIAuthenticationToken(authenticationToken); return ds.createQuery(entityClazz).field("authenticationToken").equal(authToken).get(); }
From source file:com.iterzp.momo.utils.WebUtils.java
/** * cookie//from ww w. j ava 2 s . co m * * @param request * HttpServletRequest * @param response * HttpServletResponse * @param name * cookie?? * @param path * * @param domain * */ public static void removeCookie(HttpServletRequest request, HttpServletResponse response, String name, String path, String domain) { Assert.notNull(request); Assert.notNull(response); Assert.hasText(name); try { name = URLEncoder.encode(name, "UTF-8"); Cookie cookie = new Cookie(name, null); cookie.setMaxAge(0); if (StringUtils.isNotEmpty(path)) { cookie.setPath(path); } if (StringUtils.isNotEmpty(domain)) { cookie.setDomain(domain); } response.addCookie(cookie); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } }
From source file:io.twipple.springframework.data.clusterpoint.convert.ClusterpointDocumentPropertyAccessor.java
@Override public boolean canWrite(@NotNull EvaluationContext context, @NotNull Object target, @NotNull String name) throws AccessException { Assert.notNull(context);/*from ww w. j a v a 2 s. c o m*/ Assert.notNull(target); Assert.isInstanceOf(ClusterpointDocument.class, target); Assert.hasText(name); ClusterpointDocument source = (ClusterpointDocument) target; return source.canWrite(context, name); }
From source file:com.emc.vipr.sync.source.CasSource.java
@Override public void configure(SyncSource source, Iterator<SyncFilter> filters, SyncTarget target) { if (!(target instanceof CuaFilesystemTarget) && !(target instanceof CasTarget)) throw new ConfigurationException( "CasSource is currently only compatible with CasTarget or CuaFilesystemTarget"); Assert.hasText(connectionString); if (clipIdFile != null && !"-".equals(clipIdFile)) { // Verify file File f = new File(clipIdFile); if (!f.exists()) throw new ConfigurationException(String.format("The clip list file %s does not exist", clipIdFile)); }// ww w. j av a2 s .c o m try { if (pool == null) { FPPool.RegisterApplication(APPLICATION_NAME, APPLICATION_VERSION); pool = new FPPool(connectionString); } // Check connection FPPool.PoolInfo info = pool.getPoolInfo(); LogMF.info(l4j, "Connected to source: {0} ({1}) using CAS v.{2}", info.getClusterName(), info.getClusterID(), info.getVersion()); // verify we have appropriate privileges if (pool.getCapability(FPLibraryConstants.FP_READ, FPLibraryConstants.FP_ALLOWED).equals("False")) throw new ConfigurationException("READ is not supported for this pool connection"); } catch (FPLibraryException e) { throw new RuntimeException("error creating pool", e); } }
From source file:org.synyx.hera.si.PluginRegistryAwareMessageHandler.java
/** * Sets the SpEL expression to extract the delimiter from the {@link Message}. * //from ww w . j a v a 2 s . c o m * @param delimiterExpression the delimiterExpression to set */ public void setDelimiterExpression(String expression) { Assert.hasText(expression); this.delimiterExpression = parser.parseExpression(expression); }