本文整理汇总了Java中org.alfresco.util.ParameterCheck.mandatory方法的典型用法代码示例。如果您正苦于以下问题:Java ParameterCheck.mandatory方法的具体用法?Java ParameterCheck.mandatory怎么用?Java ParameterCheck.mandatory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.util.ParameterCheck
的用法示例。
在下文中一共展示了ParameterCheck.mandatory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDownloadsCannedQuery
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
public CannedQuery<DownloadEntity> getDownloadsCannedQuery(NodeRef containerNode, Date before)
{
ParameterCheck.mandatory("before", before);
GetDownloadsCannedQueryParams parameterBean = new GetDownloadsCannedQueryParams
(
getNodeId(containerNode),
getQNameId(ContentModel.PROP_NAME),
getQNameId(DownloadModel.TYPE_DOWNLOAD),
before
);
CannedQueryParameters params = new CannedQueryParameters(parameterBean);
final GetDownloadsCannedQuery cq = new GetDownloadsCannedQuery(
cannedQueryDAO, methodSecurity, params
);
return cq;
}
示例2: setChildNodeNameAll
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* Helper method to set all values associated with the
* {@link #setChildNodeName(String) child node name}.
*
* @param dictionaryService the service that determines how the CRC values are generated.
* If this is <tt>null</tt> then the CRC values are generated
* assuming that positive enforcement of the name constraint is
* required.
* @param childNodeName the child node name
*/
public void setChildNodeNameAll(
DictionaryService dictionaryService,
QName typeQName,
String childNodeName)
{
ParameterCheck.mandatory("childNodeName", childNodeName);
if (dictionaryService != null)
{
ParameterCheck.mandatory("typeQName", typeQName);
Pair<String, Long> childNameUnique = ChildAssocEntity.getChildNameUnique(
dictionaryService,
typeQName,
childNodeName);
this.childNodeName = childNameUnique.getFirst();
this.childNodeNameCrc = childNameUnique.getSecond();
}
else
{
String childNameNewLower = childNodeName.toLowerCase();
this.childNodeName = ChildAssocEntity.getChildNodeNameShort(childNameNewLower);
this.childNodeNameCrc = ChildAssocEntity.getChildNodeNameCrc(childNameNewLower);
}
}
示例3: getModelNamespaceUriPrefix
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
private Pair<String, String> getModelNamespaceUriPrefix(M2Model model)
{
ParameterCheck.mandatory("model", model);
List<M2Namespace> namespaces = model.getNamespaces();
if (namespaces.isEmpty())
{
throw new CustomModelException.InvalidNamespaceException(MSG_NAMESPACE_NOT_EXISTS, new Object[] { model.getName() });
}
if (namespaces.size() > 1)
{
throw new CustomModelException.InvalidNamespaceException(MSG_NAMESPACE_MANY_EXIST, new Object[] { model.getName() });
}
M2Namespace ns = namespaces.iterator().next();
return new Pair<>(ns.getUri(), ns.getPrefix());
}
示例4: getMaxPropertyValueInstanceId
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Long getMaxPropertyValueInstanceId(final PropertyValueTableType valueTableType)
{
ParameterCheck.mandatory("valueTableType", valueTableType);
final String query;
switch (valueTableType)
{
case DOUBLE:
query = SELECT_MAX_PROPERTY_DOUBLE_VALUE_ID;
break;
case SERIALIZABLE:
query = SELECT_MAX_PROPERTY_SERIALIZABLE_VALUE_ID;
break;
case STRING:
query = SELECT_MAX_PROPERTY_STRING_VALUE_ID;
break;
default:
throw new IllegalArgumentException("Unsupported value table type: " + valueTableType);
}
final Long maxPropertyValueInstanceId = this.sqlSessionTemplate.selectOne(query);
LOGGER.debug("Selected max ID {} for alf_prop_*_value type {}", maxPropertyValueInstanceId, valueTableType);
return maxPropertyValueInstanceId;
}
示例5: getCustomType
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public TypeDefinition getCustomType(QName name)
{
ParameterCheck.mandatory("name", name);
CompiledModel compiledModel = getModelByUri(name.getNamespaceURI());
if (compiledModel != null)
{
return compiledModel.getType(name);
}
return null;
}
示例6: getName
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public QName getName(NodeRef inNodeRef, QName name)
{
ParameterCheck.mandatory("InNodeRef", inNodeRef);
int idx = inNodeRef.getStoreRef().getIdentifier().lastIndexOf(SEPARATOR);
if (idx != -1)
{
String tenantDomain = inNodeRef.getStoreRef().getIdentifier().substring(1, idx);
checkTenantEnabled(tenantDomain);
return getName(name, tenantDomain);
}
return name;
}
示例7: createCustomModel
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public CustomModelDefinition createCustomModel(M2Model m2Model, boolean activate)
{
ParameterCheck.mandatory("m2Model", m2Model);
String modelName = m2Model.getName();
int colonIndex = modelName.indexOf(QName.NAMESPACE_PREFIX);
final String modelFileName = (colonIndex == -1) ? modelName : modelName.substring(colonIndex + 1);
if (isModelExists(modelFileName))
{
throw new CustomModelException.ModelExistsException(MSG_NAME_ALREADY_IN_USE, new Object[] { modelFileName });
}
// Validate the model namespace URI
validateModelNamespaceUri(getModelNamespaceUriPrefix(m2Model).getFirst());
// Validate the model namespace prefix
validateModelNamespacePrefix(getModelNamespaceUriPrefix(m2Model).getSecond());
// Return the created model definition
CompiledModel compiledModel = createUpdateModel(modelFileName, m2Model, activate, MSG_CREATE_MODEL_ERR, false);
CustomModelDefinition modelDef = new CustomModelDefinitionImpl(compiledModel, activate, dictionaryService);
if (logger.isDebugEnabled())
{
logger.debug(modelFileName + " model has been created.");
}
return modelDef;
}
示例8: getNodePairNotNull
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* Performs a null-safe get of the node
*
* @param nodeRef the node to retrieve
* @return Returns the node entity (never null)
* @throws InvalidNodeRefException if the referenced node could not be found
*/
private Pair<Long, NodeRef> getNodePairNotNull(NodeRef nodeRef) throws InvalidNodeRefException
{
ParameterCheck.mandatory("nodeRef", nodeRef);
Pair<Long, NodeRef> unchecked = nodeDAO.getNodePair(nodeRef);
if (unchecked == null)
{
Status nodeStatus = nodeDAO.getNodeRefStatus(nodeRef);
throw new InvalidNodeRefException("Node does not exist: " + nodeRef + " (status:" + nodeStatus + ")", nodeRef);
}
return unchecked;
}
示例9: getGetDraftsCannedQuery
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
public CannedQuery<BlogEntity> getGetDraftsCannedQuery(NodeRef blogContainerNode, String username, PagingRequest pagingReq)
{
ParameterCheck.mandatory("blogContainerNode", blogContainerNode);
ParameterCheck.mandatory("pagingReq", pagingReq);
int requestTotalCountMax = pagingReq.getRequestTotalCountMax();
//FIXME Need tenant service like for GetChildren?
boolean isPublished = false;
GetBlogPostsCannedQueryParams paramBean = new GetBlogPostsCannedQueryParams(getNodeId(blogContainerNode),
getQNameId(ContentModel.PROP_NAME),
getQNameId(ContentModel.PROP_PUBLISHED),
getQNameId(ContentModel.TYPE_CONTENT),
username,
isPublished,
null, null,
null, null);
CannedQueryPageDetails cqpd = createCQPageDetails(pagingReq);
CannedQuerySortDetails cqsd = createCQSortDetails(ContentModel.PROP_CREATED, SortOrder.DESCENDING);
// create query params holder
CannedQueryParameters params = new CannedQueryParameters(paramBean, cqpd, cqsd, requestTotalCountMax, pagingReq.getQueryExecutionId());
// return canned query instance
return getCannedQuery(params);
}
示例10: processJson
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* Parses the json returned from the suggester
*
* @param json the JSON object
* @throws JSONException
*/
@SuppressWarnings("rawtypes")
protected void processJson(JSONObject json) throws JSONException
{
ParameterCheck.mandatory("json", json);
if (logger.isDebugEnabled())
{
logger.debug("Suggester JSON response: " + json);
}
JSONObject suggest = json.getJSONObject("suggest");
for (Iterator suggestIterator = suggest.keys(); suggestIterator.hasNext(); /**/)
{
String dictionary = (String) suggestIterator.next();
JSONObject dictionaryJsonObject = suggest.getJSONObject(dictionary);
for (Iterator dicIterator = dictionaryJsonObject.keys(); dicIterator.hasNext(); /**/)
{
String termStr = (String) dicIterator.next();
JSONObject termJsonObject = dictionaryJsonObject.getJSONObject(termStr);
// number found
this.numberFound = termJsonObject.getLong("numFound");
// the suggested terms
JSONArray suggestion = termJsonObject.getJSONArray("suggestions");
for (int i = 0, length = suggestion.length(); i < length; i++)
{
JSONObject data = suggestion.getJSONObject(i);
this.suggestions.add(new Pair<String, Integer>(data.getString("term"), data.getInt("weight")));
}
}
}
}
示例11: afterPropertiesSet
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
ParameterCheck.mandatory("queries", this.queries);
}
示例12: afterPropertiesSet
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
ParameterCheck.mandatory("nodes", this.nodes);
}
示例13: afterPropertiesSet
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
ParameterCheck.mandatory("groups", groups);
}
示例14: afterPropertiesSet
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
ParameterCheck.mandatory("downloads", this.downloads);
}
示例15: afterPropertiesSet
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
super.afterPropertiesSet();
ParameterCheck.mandatory("actions", actions);
}