当前位置: 首页>>代码示例>>Java>>正文


Java ParameterCheck.mandatory方法代码示例

本文整理汇总了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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:GetDownloadsCannedQueryFactory.java

示例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);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:36,代码来源:ChildAssocEntity.java

示例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());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:CustomModelServiceImpl.java

示例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;
}
 
开发者ID:Acosix,项目名称:alfresco-audit,代码行数:28,代码来源:PropertyTablesCleanupDAOImpl.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:14,代码来源:CustomModelServiceImpl.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:16,代码来源:MultiTServiceImpl.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:30,代码来源:CustomModelServiceImpl.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:DbNodeServiceImpl.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:28,代码来源:GetBlogPostsCannedQueryFactory.java

示例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")));
            }
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:41,代码来源:SolrSuggesterResult.java

示例11: afterPropertiesSet

import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
    ParameterCheck.mandatory("queries", this.queries);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:6,代码来源:QueriesEntityResource.java

示例12: afterPropertiesSet

import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
    ParameterCheck.mandatory("nodes", this.nodes);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:6,代码来源:NodesEntityResource.java

示例13: afterPropertiesSet

import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
    ParameterCheck.mandatory("groups", groups);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:6,代码来源:PersonGroupsRelation.java

示例14: afterPropertiesSet

import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
    ParameterCheck.mandatory("downloads", this.downloads);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:6,代码来源:DownloadsEntityResource.java

示例15: afterPropertiesSet

import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet()
{
    super.afterPropertiesSet();
    ParameterCheck.mandatory("actions", actions);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:7,代码来源:NodeActionDefinitionsRelation.java


注:本文中的org.alfresco.util.ParameterCheck.mandatory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。