List of usage examples for org.apache.commons.lang NullArgumentException NullArgumentException
public NullArgumentException(String argName)
Instantiates with the given argument name.
From source file:it.geosolutions.geoserver.jms.impl.handlers.catalog.CatalogUtils.java
public static DataStoreInfo localizeDataStore(final DataStoreInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info == null || catalog == null) throw new NullArgumentException("Arguments may never be null"); final DataStoreInfo localObject = catalog.getDataStoreByName(info.getWorkspace(), info.getName()); final CatalogBuilder builder = new CatalogBuilder(catalog); if (localObject != null) { return localObject; }/*from w ww . j ava 2 s . c om*/ final DataStoreInfo createdObject = catalog.getFactory().createDataStore(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog)); builder.attach(createdObject); return createdObject; }
From source file:com.wavemaker.runtime.server.ControllerBase.java
protected TypedServiceReturn invokeMethod(ServiceWire sw, String method, JSONArray jsonArgs, Map<String, Object[]> mapParams, ServiceResponse serviceResponse) throws WMException { if (jsonArgs != null && mapParams != null) { throw new WMRuntimeException(MessageResource.BOTH_ARGUMENT_TYPES, jsonArgs, mapParams); } else if (sw == null) { throw new NullArgumentException("sw"); }/*ww w . j a v a 2 s .co m*/ sw.getServiceType().setup(sw, this.internalRuntime, this.runtimeAccess); JSONState jsonState = getInternalRuntime().getJSONState(); ParsedServiceArguments args; if (mapParams != null) { args = sw.getServiceType().parseServiceArgs(sw, method, mapParams, jsonState); } else { args = sw.getServiceType().parseServiceArgs(sw, method, jsonArgs, jsonState); } getInternalRuntime().setDeserializedProperties(args.getGettersCalled()); return ServerUtils.invokeMethodWithEvents(getServiceEventNotifier(), sw, method, args, jsonState, false, serviceResponse); }
From source file:br.com.blackhubos.eventozero.factory.Event.java
/** * Define um jogador como espectador. TODO: (o jogador deveria ser * teleportado para o lugar do evento por aqui ou pelo comando?) * * @param player Jogador em questo a virar espectador * @return Retorna a instncia do {@link Event} modificada. *///from ww w. j a v a 2 s . c o m public Event spectatorJoin(final Player player) { if ((player == null) || !player.isOnline()) throw new NullArgumentException("Player is null"); if (!this.spectators.contains(player)) { getPlayers().forEach(p -> p.hidePlayer(player)); player.setAllowFlight(true); player.setFlying(true); this.spectators.add(player); } return this; }
From source file:m.c.m.proxyma.resource.ProxymaResponseDataBean.java
/** * Removes the Cookie with the given name.<br/> * If the Cookie is not found, nothing is done.<br/> * You can always use the containsCookie method to test for the presence * of a Cookie before remove it.//from w w w. java 2s . c o m * * @param cookieName The name of the cookie to remove * @throws NullArgumentException if the passed parameter is null */ public void deleteCookie(String cookieName) throws NullArgumentException { if (cookieName == null) throw new NullArgumentException("You can't delete a null Cookie"); this.cookies.remove(cookieName); }
From source file:it.geosolutions.geoserver.jms.impl.handlers.catalog.CatalogUtils.java
public static WMSStoreInfo localizeWMSStore(final WMSStoreInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info == null || catalog == null) throw new NullArgumentException("Arguments may never be null"); final WMSStoreInfo localObject = catalog.getStoreByName(info.getWorkspace(), info.getName(), WMSStoreInfo.class); final CatalogBuilder builder = new CatalogBuilder(catalog); if (localObject != null) { return localObject; }/* ww w .ja va2s . c o m*/ final WMSStoreInfo createdObject = catalog.getFactory().createWebMapServer(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog)); builder.attach(createdObject); return createdObject; }
From source file:br.com.blackhubos.eventozero.factory.Event.java
/** * Remove um jogador do modo espectador. * * @param player Jogador que ser removido do modo espectador. * @return Retorna a instncia do {@link Event} modificada. *///from w w w . j a v a 2 s.c om public Event spectatorQuit(final Player player) { if ((player == null) || player.isOnline()) throw new NullArgumentException("Player is null"); if (this.spectators.contains(player)) { for (final Player obj : this.getPlayers()) { obj.showPlayer(player); } player.setAllowFlight(false); player.setFlying(false); this.spectators.remove(player); } return this; }
From source file:com.eyeq.pivot4j.ui.RenderContext.java
/** * @param logger/*w ww.j a v a 2s. c o m*/ * the logger to set */ public void setLogger(Logger logger) { if (logger == null) { throw new NullArgumentException("logger"); } this.logger = logger; }
From source file:com.eyeq.pivot4j.ui.AbstractPivotRenderer.java
/** * @see com.eyeq.pivot4j.ui.PivotRenderer#getAggregators(org.olap4j.Axis, * com.eyeq.pivot4j.ui.aggregator.AggregatorPosition) *///w w w . j ava2s .c o m @Override public List<String> getAggregators(Axis axis, AggregatorPosition position) { if (axis == null) { throw new NullArgumentException("axis"); } if (position == null) { throw new NullArgumentException("position"); } List<String> names = aggregatorNames.get(new AggregatorKey(axis, position)); if (names == null) { names = Collections.emptyList(); } return names; }
From source file:it.geosolutions.geoserver.jms.impl.handlers.catalog.CatalogUtils.java
public static CoverageStoreInfo localizeCoverageStore(final CoverageStoreInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info == null || catalog == null) throw new NullArgumentException("Arguments may never be null"); final CoverageStoreInfo localObject = catalog.getCoverageStoreByName(info.getWorkspace(), info.getName()); final CatalogBuilder builder = new CatalogBuilder(catalog); if (localObject != null) { return localObject; }//from w w w. j a v a2 s . c o m final CoverageStoreInfo createdObject = catalog.getFactory().createCoverageStore(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setWorkspace(localizeWorkspace(info.getWorkspace(), catalog)); builder.attach(createdObject); return createdObject; }
From source file:info.semanticsoftware.lodexporter.tdb.TDBTripleStoreImpl.java
private HashMap<String, LinkedList<RelationMapping>> populateRelationMapList(final ResultSet rs) { final HashMap<String, LinkedList<RelationMapping>> relationHash = new HashMap<String, LinkedList<RelationMapping>>(); try {/* w w w .j a v a 2 s . c o m*/ while (rs.hasNext()) { final QuerySolution soln = rs.nextSolution(); final RDFNode ruleNode = soln.get("?rule"); String ruleString = null; if (ruleNode != null) ruleString = ruleNode.asResource().getURI(); // System.out.println("Rule:" + ruleNode + ", localName=" + // ruleNode.asResource().getLocalName() + ", nameSpace=" + // ruleNode.asResource().getNameSpace()); final RDFNode domainNode = soln.get("?domain"); String domainString = null; if (domainNode != null) { domainString = domainNode.asResource().getURI(); } else { throw new NullArgumentException("Missing domain for rule: " + ruleString); } final RDFNode rangeNode = soln.get("?range"); String rangeString = null; if (rangeNode != null) { rangeString = rangeNode.asResource().getURI(); } else { throw new NullArgumentException("Missing range for rule: " + ruleString); } final RDFNode typeNode = soln.get("?type"); String typeString = null; if (typeNode != null) typeString = model.expandPrefix(typeNode.asResource().getURI()); final RDFNode GATEattributeNode = soln.get("?GATEattribute"); String GATEattributeString = null; if (GATEattributeNode != null) GATEattributeString = GATEattributeNode.asLiteral().getString(); final RelationMapping newMap = new RelationMapping(ruleString, typeString, domainString, rangeString, GATEattributeString); // NOPMD if (relationHash.containsKey(domainString)) { relationHash.get(domainString).add(newMap); } else { LinkedList<RelationMapping> relationMaps = new LinkedList<>(); relationMaps.add(newMap); relationHash.put(domainString, relationMaps); } } } catch (Exception e) { LOGGER.error("Error populating the relation hashmap.", e); } LOGGER.debug("----- RELATION HASHMAP:" + relationHash); return relationHash; }