Example usage for org.apache.commons.lang NullArgumentException NullArgumentException

List of usage examples for org.apache.commons.lang NullArgumentException NullArgumentException

Introduction

In this page you can find the example usage for org.apache.commons.lang NullArgumentException NullArgumentException.

Prototype

public NullArgumentException(String argName) 

Source Link

Document

Instantiates with the given argument name.

Usage

From source file:com.eyeq.pivot4j.transform.impl.DrillThroughImpl.java

/**
 * @see com.eyeq.pivot4j.transform.DrillThrough#drillThrough(org.olap4j.Cell,
 *      java.util.List, int)/*from  w ww  .  jav  a 2s. c o  m*/
 */
@Override
public ResultSet drillThrough(Cell cell, List<MetadataElement> selection, int maximumRows) {
    if (cell == null) {
        throw new NullArgumentException("cell");
    }

    ResultSet result;

    if (selection != null && !selection.isEmpty() || maximumRows > 0) {
        result = performDrillThroughMdx(cell, selection, maximumRows);
    } else {
        result = performDrillThrough(cell);
    }

    return result;
}

From source file:com.eyeq.pivot4j.util.RaggedMemberWrapper.java

/**
 * @param member//from   w ww  .  j av  a2 s .c  om
 * @param cube
 */
public RaggedMemberWrapper(Member member, Cube cube) {
    if (member == null) {
        throw new NullArgumentException("member");
    }

    int baseDepth = member.getDepth();

    if (baseDepth <= 1 || member.getParentMember() != null) {
        throw new IllegalArgumentException("The specified member does not need a ragged parent placeholder.");
    }

    this.baseMember = member;
    this.nameSegments = Collections.unmodifiableList(IdentifierParser.parseIdentifier(member.getUniqueName()));

    while (topMember == null && baseDepth > 0) {
        try {
            this.topMember = cube.lookupMember(nameSegments.subList(0, baseDepth));
        } catch (OlapException e) {
            throw new PivotException(e);
        }

        if (topMember != null) {
            break;
        }

        baseDepth--;
    }

    if (topMember == null) {
        throw new IllegalArgumentException("Unable to find a valid parent of the specified member : " + member);
    }

    initialize(baseMember, topMember, nameSegments, member.getLevel());
}

From source file:com.eyeq.pivot4j.ui.condition.DefaultConditionFactory.java

/**
 * @see com.eyeq.pivot4j.ui.condition.ConditionFactory#createCondition(java.lang.String)
 *//*from ww  w .j a va2  s  .c  o  m*/
@Override
public Condition createCondition(String name) {
    if (name == null) {
        throw new NullArgumentException("name");
    }

    Condition condition = null;

    Class<? extends Condition> type = types.get(name);

    if (type != null) {
        if (logger.isDebugEnabled()) {
            logger.debug("Instantiating a new condition : " + type);
        }

        try {
            Constructor<? extends Condition> constructor = type.getConstructor(ConditionFactory.class);
            condition = constructor.newInstance(this);
        } catch (Exception e) {
            throw new PivotException(e);
        }
    }

    if (condition == null && logger.isWarnEnabled()) {
        logger.warn("Unknown condition name : " + name);
    }

    return condition;
}

From source file:com.eyeq.pivot4j.ui.property.PropertySupport.java

/**
 * @param property/*from  w ww .j av  a 2 s.c  om*/
 * @see com.eyeq.pivot4j.ui.property.PropertySource#setProperty(com.eyeq.pivot4j.ui.property.Property)
 */
public void setProperty(Property property) {
    if (property == null) {
        throw new NullArgumentException("property");
    }

    properties.put(property.getName(), property);
}

From source file:com.eyeq.pivot4j.ui.property.ConditionalProperty.java

/**
 * @param name//from   w w w.  j a v  a2s. co  m
 * @param defaultValue
 * @param values
 * @param conditionFactory
 */
public ConditionalProperty(String name, String defaultValue, List<ConditionalValue> values,
        ConditionFactory conditionFactory) {
    super(name);

    if (conditionFactory == null) {
        throw new NullArgumentException("conditionFactory");
    }

    this.defaultValue = defaultValue;
    this.values = values;
    this.conditionFactory = conditionFactory;
}

From source file:com.comphenix.xp.rewards.xp.RewardVirtual.java

@Override
public boolean canReward(Player player, ResourceHolder resource) {

    if (player == null)
        throw new NullArgumentException("player");
    if (!isExperience(resource))
        throw new IllegalArgumentException("Must be a experience resource.");

    ExperienceManager manager = new ExperienceManager(player);

    // See if we'd end up with negative experience
    if (resource.getAmount() < 0) {
        return manager.hasExp(-resource.getAmount() * getLevelingFactor(levelingRate, player, manager));
    } else {/*from   w  w w  .j av a  2 s  .  co  m*/
        return true;
    }
}

From source file:com.eyeq.pivot4j.query.QuaxUtil.java

/**
 * @param cube/*w w  w.j  av a  2s .co m*/
 */
public QuaxUtil(Cube cube) {
    if (cube == null) {
        throw new NullArgumentException("cube");
    }

    this.cube = cube;
}

From source file:it.geosolutions.geoserver.jms.impl.handlers.catalog.CatalogUtils.java

/**
 * @param info/* ww w.j av a 2  s . c  o  m*/
 * @param catalog
 * @return the local style or the passed one (if not exists locally)
 */
public static StyleInfo localizeStyle(final StyleInfo info, final Catalog catalog) {
    if (info == null || catalog == null)
        throw new NullArgumentException("Arguments may never be null");

    final StyleInfo localObject = catalog.getStyleByName(info.getName());
    if (localObject != null) {
        return localObject;
    } else {
        if (LOGGER.isLoggable(java.util.logging.Level.INFO)) {
            LOGGER.info("No such style called \'" + info.getName() + "\' can be found: LOCALIZATION");
        }
        final CatalogBuilder builder = new CatalogBuilder(catalog);
        builder.attach(info);
        return info;
    }
}

From source file:com.comphenix.xp.messages.MessageQueue.java

public void enqueue(Action action, MessageFormatter formatter) {

    if (formatter == null)
        throw new NullArgumentException("formatter");

    // Special case
    if (messageDelay == 0) {
        transmitt(action, formatter);/*from w  w  w.j  a va2s .com*/
        return;
    }

    // Enqueue the message
    if (lookup.containsKey(action)) {
        lookup.put(action, MessageFormatter.add(lookup.get(action), formatter));
    } else {
        lookup.put(action, formatter);
        ordered.add(action);
    }
}

From source file:com.comphenix.xp.rewards.xp.RewardExperience.java

@Override
public void reward(Player player, Location point, ResourceHolder resource) {
    if (player == null)
        throw new NullArgumentException("player");
    if (point == null)
        throw new NullArgumentException("point");
    if (!isExperience(resource))
        throw new IllegalArgumentException("Must be a experience resource.");

    // Create the experience at this location
    Server.spawnExperience(player.getWorld(), point, resource.getAmount());
}