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


Java Group.getAttribute方法代码示例

本文整理汇总了Java中gov.nih.nci.cagrid.cqlquery.Group.getAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java Group.getAttribute方法的具体用法?Java Group.getAttribute怎么用?Java Group.getAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nih.nci.cagrid.cqlquery.Group的用法示例。


在下文中一共展示了Group.getAttribute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateGroupModel

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
private void validateGroupModel(Object current, Group group, DomainModel model) throws DomainConformanceException {
	if (group.getAttribute() != null) {
		UMLClass classMd = getUmlClass(current.getName(), model);
		for (int i = 0; i < group.getAttribute().length; i++) {
			validateAttributeModel(group.getAttribute(i), classMd);
		}
	}

	if (group.getAssociation() != null) {
		for (int i = 0; i < group.getAssociation().length; i++) {
			validateAssociationModel(current, group.getAssociation(i), model);
		}
	}

	if (group.getGroup() != null) {
		for (int i = 0; i < group.getGroup().length; i++) {
			validateGroupModel(current, group.getGroup(i), model);
		}
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:21,代码来源:DomainModelValidator.java

示例2: validateGroupModel

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
private void validateGroupModel(Object current, Group group, DomainModel model) throws MalformedQueryException {
    if (group.getAttribute() != null) {
        UMLClass classMd = getUmlClass(current.getName(), model);
        for (int i = 0; i < group.getAttribute().length; i++) {
            validateAttributeModel(model, group.getAttribute(i), classMd);
        }
    }

    if (group.getAssociation() != null) {
        for (int i = 0; i < group.getAssociation().length; i++) {
            validateAssociationModel(current, group.getAssociation(i), model);
        }
    }

    if (group.getGroup() != null) {
        for (int i = 0; i < group.getGroup().length; i++) {
            validateGroupModel(current, group.getGroup(i), model);
        }
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:21,代码来源:ISODomainModelValidator.java

示例3: convertGroup

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
private CQLGroup convertGroup(String parentClassName, Group cqlGroup) throws QueryConversionException {
    CQLGroup group = new CQLGroup();
    if (cqlGroup.getAssociation() != null) {
        CQLAssociatedObject[] associations = new CQLAssociatedObject[cqlGroup.getAssociation().length];
        for (int i = 0; i < cqlGroup.getAssociation().length; i++) {
            associations[i] = convertAssociation(parentClassName, cqlGroup.getAssociation(i));
        }
        group.setCQLAssociatedObject(associations);
    }
    if (cqlGroup.getAttribute() != null) {
        List<CQLAttribute> convertedAttributes = new LinkedList<CQLAttribute>();
        for (Attribute attrib : cqlGroup.getAttribute()) {
            CQLAttribute conversion = null;
            if (unaryPredicateConversion.containsKey(attrib.getPredicate())) {
                conversion = convertUnaryAttribute(attrib);
            } else {
                conversion = convertBinaryAttribute(parentClassName, attrib);
            }
            convertedAttributes.add(conversion);
        }
        if (convertedAttributes.size() != 0) {
            CQLAttribute[] conversions = new CQLAttribute[convertedAttributes.size()];
            convertedAttributes.toArray(conversions);
            group.setCQLAttribute(conversions);
        }
    }
    if (cqlGroup.getGroup() != null) {
        CQLGroup[] groups = new CQLGroup[cqlGroup.getGroup().length];
        for (int i = 0; i < cqlGroup.getGroup().length; i++) {
            groups[i] = convertGroup(parentClassName, cqlGroup.getGroup(i));
        }
        group.setCQLGroup(groups);
    }
    GroupLogicalOperator logic = 
        cqlGroup.getLogicRelation() == LogicalOperator.AND 
            ? GroupLogicalOperator.AND : GroupLogicalOperator.OR;
    group.setLogicalOperation(logic);
    return group;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:40,代码来源:CQL1toCQL2Converter.java

示例4: processGroup

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
/**
 * Processes a CQL group into HQL
 *
 * @param group
 * 		The CQL Group
 * @param hql
 * 		The HQL fragment which will be edited
    * @param parameters
    *      The positional HQL query parameters
 * @param associationTrace
 * 		The trace of associations
 * @param sourceClassName
 * 		The class to which this group belongs
 * @throws QueryProcessingException
 */
private void processGroup(Group group, StringBuilder hql, List<java.lang.Object> parameters,
       Stack<Association> associationStack, Object sourceQueryObject, String sourceAlias) throws QueryProcessingException {
       LOG.debug("Processing group on " + sourceQueryObject.getName());

	String logic = convertLogicalOperator(group.getLogicRelation());
	boolean mustAddLogic = false;

	// open the group
	hql.append('(');

	if (group.getAssociation() != null) {
		for (int i = 0; i < group.getAssociation().length; i++) {
			mustAddLogic = true;
			processAssociation(group.getAssociation(i), hql, parameters, associationStack, sourceQueryObject, sourceAlias);
			if (i + 1 < group.getAssociation().length) {
				hql.append(' ').append(logic).append(' ');
			}
		}
	}
	if (group.getAttribute() != null) {
		if (mustAddLogic) {
			hql.append(' ').append(logic).append(' ');
		}
		for (int i = 0; i < group.getAttribute().length; i++) {
			mustAddLogic = true;
			processAttribute(group.getAttribute(i), hql, parameters, sourceQueryObject, sourceAlias);
			if (i + 1 < group.getAttribute().length) {
				hql.append(' ').append(logic).append(' ');
			}
		}
	}
	if (group.getGroup() != null) {
		if (mustAddLogic) {
			hql.append(' ').append(logic).append(' ');
		}
		for (int i = 0; i < group.getGroup().length; i++) {
			processGroup(group.getGroup(i), hql, parameters, associationStack, sourceQueryObject, sourceAlias);
			if (i + 1 < group.getGroup().length) {
				hql.append(' ').append(logic).append(' ');
			}
		}
	}

	// close the group
	hql.append(')');
}
 
开发者ID:NCIP,项目名称:cananolab,代码行数:62,代码来源:PublicDataCQL2ParameterizedHQL.java

示例5: processGroup

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
/**
 * Processes a CQL group into HQL
 * 
 * @param group
 * 		The CQL Group
 * @param hql
 * 		The HQL fragment which will be edited
    * @param parameters
    *      The positional HQL query parameters
 * @param associationTrace
 * 		The trace of associations
 * @param sourceClassName
 * 		The class to which this group belongs
 * @throws QueryTranslationException
 */
private void processGroup(Group group, StringBuilder hql, List<java.lang.Object> parameters,
       Stack<Association> associationStack, List<CqlDataBucket> typesProcessingList, 
       Object sourceQueryObject, String sourceAlias) throws QueryTranslationException {
       LOG.debug("Processing group on " + sourceQueryObject.getName());
       
	String logic = convertLogicalOperator(group.getLogicRelation());
	boolean mustAddLogic = false;
	
	// open the group
	hql.append('(');
	
	if (group.getAttribute() != null) {
           for (int i = 0; i < group.getAttribute().length; i++) {
               mustAddLogic = true;
               processAttribute(group.getAttribute(i), hql, parameters, 
                   sourceQueryObject, sourceAlias, associationStack, typesProcessingList);
               if (i + 1 < group.getAttribute().length) {
                   hql.append(' ').append(logic).append(' ');
               }
           }
       }
	if (group.getAssociation() != null) {
	    if (mustAddLogic) {
               hql.append(' ').append(logic).append(' ');
           }
		for (int i = 0; i < group.getAssociation().length; i++) {
			mustAddLogic = true;
			processAssociation(group.getAssociation(i), hql, parameters, 
			    associationStack, typesProcessingList, sourceQueryObject, sourceAlias);
			if (i + 1 < group.getAssociation().length) {
				hql.append(' ').append(logic).append(' ');
			}
		}
	}
	if (group.getGroup() != null) {
		if (mustAddLogic) {
			hql.append(' ').append(logic).append(' ');
		}
		for (int i = 0; i < group.getGroup().length; i++) {
			processGroup(group.getGroup(i), hql, parameters, associationStack, 
			    typesProcessingList, sourceQueryObject, sourceAlias);
			if (i + 1 < group.getGroup().length) {
				hql.append(' ').append(logic).append(' ');
			}
		}
	}
	
	// close the group
	hql.append(')');
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:66,代码来源:CQL2ParameterizedHQL.java

示例6: validateGroupStructure

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
private void validateGroupStructure(Group group) throws MalformedStructureException {
	// check the logical operator
	if (group.getLogicRelation() == null) {
		throw new MalformedStructureException("Groups must have a logical operator!");
	}
	String logic = group.getLogicRelation().getValue();
	if (!logic.equals(LogicalOperator._AND) && !logic.equals(LogicalOperator._OR)) {
		throw new MalformedStructureException("Logical operator " + logic + " is not valid");
	}
	
	// ensure two or more group members
	int groupMembers = 0;
	if (group.getAssociation() != null) {
		groupMembers += group.getAssociation().length;
	}
	if (group.getAttribute() != null) {
		groupMembers += group.getAttribute().length;
	}
	if (group.getGroup() != null) {
		groupMembers += group.getGroup().length;
	}
	
	if (groupMembers < 2) {
		throw new MalformedStructureException("Groups must have two or more members");
	}
	
	// validate the members of the group
	if (group.getAttribute() != null) {
		for (int i = 0; i < group.getAttribute().length; i++) {
			validateAttributeStructure(group.getAttribute(i));
		}
	}
	
	if (group.getAssociation() != null) {
		for (int i = 0; i < group.getAssociation().length; i++) {
			validateObjectStructure(group.getAssociation(i));
		}
	}
	
	if (group.getGroup() != null) {
		for (int i = 0; i < group.getGroup().length; i++) {
			validateGroupStructure(group.getGroup(i));
		}
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:46,代码来源:ObjectWalkingCQLValidator.java

示例7: processGroup

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
/**
 * Processes a CQL group into HQL
 * 
 * @param group
 * 		The CQL Group
 * @param hql
 * 		The HQL fragment which will be edited
    * @param parameters
    *      The positional HQL query parameters
 * @param associationTrace
 * 		The trace of associations
 * @param sourceClassName
 * 		The class to which this group belongs
 * @throws QueryProcessingException
 */
private void processGroup(Group group, StringBuilder hql, List<java.lang.Object> parameters,
       Stack<Association> associationStack, Object sourceQueryObject, String sourceAlias) throws QueryProcessingException {
       LOG.debug("Processing group on " + sourceQueryObject.getName());
       
	String logic = convertLogicalOperator(group.getLogicRelation());
	boolean mustAddLogic = false;
	
	// open the group
	hql.append('(');
	
	if (group.getAssociation() != null) {
		for (int i = 0; i < group.getAssociation().length; i++) {
			mustAddLogic = true;
			processAssociation(group.getAssociation(i), hql, parameters, associationStack, sourceQueryObject, sourceAlias);
			if (i + 1 < group.getAssociation().length) {
				hql.append(' ').append(logic).append(' ');
			}
		}
	}
	if (group.getAttribute() != null) {
		if (mustAddLogic) {
			hql.append(' ').append(logic).append(' ');
		}
		for (int i = 0; i < group.getAttribute().length; i++) {
			mustAddLogic = true;
			processAttribute(group.getAttribute(i), hql, parameters, sourceQueryObject, sourceAlias);
			if (i + 1 < group.getAttribute().length) {
				hql.append(' ').append(logic).append(' ');
			}
		}
	}
	if (group.getGroup() != null) {
		if (mustAddLogic) {
			hql.append(' ').append(logic).append(' ');
		}
		for (int i = 0; i < group.getGroup().length; i++) {
			processGroup(group.getGroup(i), hql, parameters, associationStack, sourceQueryObject, sourceAlias);
			if (i + 1 < group.getGroup().length) {
				hql.append(' ').append(logic).append(' ');
			}
		}
	}
	
	// close the group
	hql.append(')');
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:62,代码来源:CQL2ParameterizedHQL.java


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