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:org.nuclos.server.ruleengine.RuleInterface.java

/**
 * sets an field of (generic or masterdata) object with intid <code>iObjectId</code>
 * @param iObjectId  object id//from   w  ww .j  a  v  a  2  s .c  o  m
 * @param sFieldName field to change value for
 * @param iValueId new value id
 * @param oValue new value
 * @precondition iObjectId != null
 * @precondition sFieldName != null
 */
public void setField(String sEntityName, Integer iObjectId, String sFieldName, Integer iValueId, Object oValue)
        throws NuclosBusinessRuleException {
    if (iObjectId == null) {
        throw new NullArgumentException("iObjectId");
    }
    if (sFieldName == null) {
        throw new NullArgumentException("sFieldName");
    }
    if (iObjectId.equals(getObjectId())
            && (!hasRuleObjectContainer() || getRuleObjectContainerCVOIfAny().getEvent() == null
                    || !getRuleObjectContainerCVOIfAny().getEvent().isFollowUp())) {
        setField(sEntityName, sFieldName, iValueId, oValue);
    } else {
        if (Modules.getInstance().isModuleEntity(sEntityName)) {
            try {
                getRuleInterface().setAttribute(this.rulevo, iObjectId, sFieldName, iValueId, oValue,
                        customUsage);
            } catch (NuclosBusinessException ex) {
                throw new NuclosBusinessRuleException(ex);
            }
        } else {
            getRuleInterface().setMasterDataField(sEntityName, iObjectId, sFieldName, iValueId, oValue);
        }
    }
}

From source file:org.nuclos.server.ruleengine.RuleInterface.java

/**
 * sets a field of the current object./*from  w ww .java2  s  .c om*/
 * @param sFieldName field to change value for
 * @param iValueId new value id
 * @param oValue new value
 * @precondition sFieldName != null
 */
public void setField(String sEntityName, String sFieldName, Integer iValueId, Object oValue) {
    if (sFieldName == null) {
        throw new NullArgumentException("sFieldName");
    }
    if (Modules.getInstance().isModuleEntity(sEntityName)) {
        getRuleInterface().setAttribute(this.rulevo, this.getGenericObject(), sFieldName, iValueId, oValue);
    } else {
        getRuleInterface().setMasterDataField(sEntityName, this.getMasterData(), sFieldName, iValueId, oValue);
    }
}

From source file:org.nuclos.server.ruleengine.RuleInterface.java

/**
 * sets the attribute <code>sAttributeName</code> to the value <code>oValue</code> for the current generic object.
 * the data type of the attribute and oValue has to be the same
 * @param sAttributeName attribute to change value for
 * @param oValue new value//w w w.  j a  v a 2 s .  c o  m
 * @precondition sAttributeName != null
 * @deprecated
 */
@Deprecated
public void setAttributeValue(String sAttributeName, Object oValue) {
    if (sAttributeName == null) {
        throw new NullArgumentException("sAttributeName");
    }
    this.setAttribute(sAttributeName, null, oValue);
}

From source file:org.nuclos.server.ruleengine.RuleInterface.java

/**
 * sets the field <code>sFieldName</code> to the value <code>oValue</code> for the current object.
 * the data type of the field and oValue has to be the same
 * @param sFieldName field to change value for
 * @param oValue new value//from  w w w  .j a v  a 2s  .  c  o  m
 * @precondition sFieldName != null
 */
public void setFieldValue(String sEntityName, String sFieldName, Object oValue) {
    if (sFieldName == null) {
        throw new NullArgumentException("sFieldName");
    }

    this.setField(sEntityName, sFieldName, null, oValue);
}

From source file:org.nuclos.server.ruleengine.RuleInterface.java

/**
 * sets the attribute <code>sAttributeName</code> to the value <code>oValue</code> for the generic object with intid <code>iGenericObjectId</code>.
 * the data type of the attribute and oValue has to be the same
 * @param sAttributeName attribute to change value for
 * @param oValue new value//from w w w.j a v  a 2 s.co  m
 * @precondition sAttributeName != null
 * @deprecated
 */
@Deprecated
public void setAttributeValue(Integer iGenericObjectId, String sAttributeName, Object oValue)
        throws NuclosBusinessRuleException {
    if (sAttributeName == null) {
        throw new NullArgumentException("sAttributeName");
    }
    this.setAttribute(iGenericObjectId, sAttributeName, null, oValue);
}

From source file:org.nuclos.server.ruleengine.RuleInterface.java

/**
 * sets the field <code>sFieldName</code> to the value <code>oValue</code> for the object with intid <code>iObjectId</code>.
 * the data type of the field and oValue has to be the same
 * @param sEntityName//from www.j  a  v  a  2  s  .c o  m
 * @param sFieldName field to change value for
 * @param oValue new value
 * @precondition sFieldName != null
 */
public void setFieldValue(String sEntityName, Integer iObjectId, String sFieldName, Object oValue)
        throws NuclosBusinessRuleException {
    if (sFieldName == null) {
        throw new NullArgumentException("sFieldName");
    }
    this.setField(sEntityName, iObjectId, sFieldName, null, oValue);
}

From source file:org.nuclos.server.ruleengine.RuleInterface.java

/**
 * Iterates the value list of the attribute with the given name, trying to find an entry with the given value.
 * @param sAttributeName// w  ww.j  ava  2s. c o  m
 * @param oValue
 * @return the value id corresponding to the given value, if any.
 * @precondition sAttributeName != null
 */
public Integer getValueIdFromValue(String sAttributeName, Object oValue) {
    if (sAttributeName == null) {
        throw new NullArgumentException("sAttributeName");
    }
    Integer result = null;
    if (oValue != null) {
        final AttributeCVO attrcvo;
        try {
            attrcvo = AttributeCache.getInstance().getAttribute(this.getModuleId(), sAttributeName);
        } catch (NuclosAttributeNotFoundException ex) {
            throw new NuclosFatalRuleException(ex.getMessage(), ex);
        }
        final Collection<AttributeValueVO> collValues = attrcvo.getValues();
        if (collValues != null) {
            for (AttributeValueVO attrvaluevo : collValues) {
                if (oValue.equals(attrvaluevo.getValue())) {
                    result = attrvaluevo.getId();
                    break;
                }
            }
        }
    }
    return result;
}

From source file:org.nuclos.server.ruleengine.RuleInterface.java

/**
 * sets the value of an enumerated attribute (that is an attribute containing a value list). Tries to find an entry
 * in the value list containing the given value. If none is found, null is written as value id.
 * @param sAttributeName/*from ww w .j a v a2 s .c o m*/
 * @param oValue
 * @throws NuclosBusinessRuleException
 * @precondition sAttributeName != null
 */
public void setEnumeratedAttributeByValue(String sAttributeName, Object oValue)
        throws NuclosBusinessRuleException {
    if (sAttributeName == null) {
        throw new NullArgumentException("sAttributeName");
    }
    this.setAttribute(sAttributeName, this.getValueIdFromValue(sAttributeName, oValue), oValue);
}

From source file:org.nuclos.server.ruleengine.RuleInterface.java

/**
 * transfers data from iGenericObjectSource to iGenericObjectTarget
 * @param iGenericObjectSource//from   w  w w.  j  a  va 2  s.com
 * @param iGenericObjectTarget
 * @param asAttributes Array of attribute names to specify transferred data
 * @precondition asAttributes != null
 */
public void transferGenericObjectData(GenericObjectVO govoSource, Integer iGenericObjectTarget,
        String[][] asAttributes) {
    if (asAttributes == null) {
        throw new NullArgumentException("asAttributes");
    }
    final GeneratorFacadeLocal generatorFacade = ServerServiceLocator.getInstance()
            .getFacade(GeneratorFacadeLocal.class);
    generatorFacade.transferGenericObjectData(govoSource, iGenericObjectTarget, asAttributes, customUsage);
}

From source file:org.nuclos.server.ruleengine.valueobject.RuleObjectContainerCVOImpl.java

/**
 * @param govo/*from  ww  w.  j av a  2s  .c om*/
 * @param mpDependants
 * @param event
 * @precondition govo != null
 * @precondition mpDependants != null
 * @precondition event != null
 */
public RuleObjectContainerCVOImpl(Event event, GenericObjectVO govo, DependantMasterDataMap mpDependants) {
    if (govo == null) {
        throw new NullArgumentException("govo");
    }
    if (mpDependants == null) {
        throw new NullArgumentException("mpDependants");
    }
    if (event == null) {
        throw new NullArgumentException("event");
    }
    this.govo = govo;
    this.mdvo = null;
    this.realMap = mpDependants;
    this.event = event;
}