Java Code Examples for org.dom4j.Element.elementIterator()

The following are Jave code examples for showing how to use elementIterator() of the org.dom4j.Element class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: iBase4J-Common   File: XmlUtil.java   View Source Code Vote up 6 votes
/**
 * 解析XML并将其节点元素压入Dto返回(基于节点值形式的XML格式)
 * 
 * @param pStrXml 待解析的XML字符串
 * @return outDto 返回Dto
 */
public static final Map parseXml2Map(String pStrXml) {
    Map map = new HashMap();
    String strTitle = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
    Document document = null;
    try {
        if (pStrXml.indexOf("<?xml") < 0) pStrXml = strTitle + pStrXml;
        document = DocumentHelper.parseText(pStrXml);

    } catch (DocumentException e) {
        logger.error("==开发人员请注意:==\n将XML格式的字符串转换为XML DOM对象时发生错误啦!" + "\n详细错误信息如下:", e);
    }
    // 获取根节点
    Element elNode = document.getRootElement();
    // 遍历节点属性值将其压入Dto
    for (Iterator it = elNode.elementIterator(); it.hasNext();) {
        Element leaf = (Element)it.next();
        map.put(leaf.getName().toLowerCase(), leaf.getData());
    }
    return map;
}
 
Example 2
Project: iBase4J   File: XmlUtil.java   View Source Code Vote up 6 votes
/**
 * 解析XML并将其节点元素压入Dto返回(基于节点值形式的XML格式)
 * 
 * @param pStrXml 待解析的XML字符串
 * @param pXPath 节点路径(例如:"//paralist/row" 则表示根节点paralist下的row节点的xPath路径)
 * @return outDto 返回Dto
 */
public static final Map parseXml2Map(String pStrXml, String pXPath) {
	Map map = new HashMap();
	String strTitle = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
	Document document = null;
	try {
		if (pStrXml.indexOf("<?xml") < 0)
			pStrXml = strTitle + pStrXml;
		document = DocumentHelper.parseText(pStrXml);
	} catch (DocumentException e) {
		log.error("==开发人员请注意:==\n将XML格式的字符串转换为XML DOM对象时发生错误啦!" + "\n详细错误信息如下:", e);
	}
	// 获取根节点
	Element elNode = document.getRootElement();
	// 遍历节点属性值将其压入Dto
	for (Iterator it = elNode.elementIterator(); it.hasNext();) {
		Element leaf = (Element) it.next();
		map.put(leaf.getName().toLowerCase(), leaf.getData());
	}
	return map;
}
 
Example 3
Project: lams   File: Configuration.java   View Source Code Vote up 6 votes
private void findClassNames(String defaultPackage, Element startNode, Set<String> names) {
	// if we have some extends we need to check if those classes possibly could be inside the
	// same hbm.xml file...
	Iterator[] classes = new Iterator[4];
	classes[0] = startNode.elementIterator( "class" );
	classes[1] = startNode.elementIterator( "subclass" );
	classes[2] = startNode.elementIterator( "joined-subclass" );
	classes[3] = startNode.elementIterator( "union-subclass" );

	Iterator classIterator = new JoinedIterator( classes );
	while ( classIterator.hasNext() ) {
		Element element = ( Element ) classIterator.next();
		String entityName = element.attributeValue( "entity-name" );
		if ( entityName == null ) {
			entityName = getClassName( element.attribute( "name" ), defaultPackage );
		}
		names.add( entityName );
		findClassNames( defaultPackage, element, names );
	}
}
 
Example 4
Project: aaden-pay   File: LianlianBranchTest.java   View Source Code Vote up 6 votes
private void getBankBranchLabel(Document document) {
	Element element = null;
	Element roote = document.getRootElement();
	for (@SuppressWarnings("unchecked")
	Iterator<Element> it = roote.elementIterator(bNode[0]); it.hasNext();) {
		element = it.next();
		IndexModel index = new IndexModel();
		index.setId(element.attributeValue(bNode[1]));
		index.setIndexStr(element.attributeValue(bNode[4]));
		index.setIndexBody(element.attributeValue(bNode[4]));
		index.setBankCode(element.attributeValue(bNode[2]));
		index.setCityCode(element.attributeValue(bNode[3]));
		branchList.add(index);
		
	}
}
 
Example 5
Project: unitimes   File: BaseCourseOfferingImport.java   View Source Code Vote up 6 votes
private Vector<NonUniversityLocation> elementLocation(Element element, Class_ c) throws Exception {
	Vector<NonUniversityLocation> locations = new Vector<NonUniversityLocation>();
	String elementName = "location";
       if(element.element(elementName) != null){
       	for (Iterator<?> it = element.elementIterator(elementName); it.hasNext();){
			Element roomElement = (Element) it.next();
			
			String name = getRequiredStringAttribute(roomElement, "name", elementName);
			String id = getOptionalStringAttribute(roomElement, "id");
			
			NonUniversityLocation location = findNonUniversityLocation(id, name, c.getManagingDept());
			if (location != null){
				locations.add(location);
			} else {
				addMissingLocation(name + " - " + c.getSchedulingSubpart().getControllingCourseOffering().getSubjectArea().getSubjectAreaAbbreviation());
			}
		}
       }
       if (locations.isEmpty()){
       	return(null);
       } else {
       	return(locations);
       }
}
 
Example 6
Project: joai-project   File: FrameworkConfigReader.java   View Source Code Vote up 6 votes
/**
 *  Gets the pageList attribute of the FrameworkConfigReader object
 *
 * @return    The pageList value
 */
public PageList getPageList() {
	if (this.pageList == null) {
		pageList = new PageList();
		Node editorPagesNode = getNode("/frameworkConfigRecord/editorInfo/editorPages");
		if (editorPagesNode != null) {
			Element fieldInfoElement = (Element) editorPagesNode;
			for (Iterator i = fieldInfoElement.elementIterator(); i.hasNext(); ) {
				Element editorPage = (Element) i.next();
				String pageLabel = editorPage.attributeValue("pageLabel");
				String elementName = editorPage.getText();
				pageList.addPage(elementName, pageLabel);
			}
		}
		String firstPage = getNodeText("/frameworkConfigRecord/editorInfo/firstPage");
		if (firstPage == null || firstPage.trim().length() == 0)
			firstPage = this.getRootElementName();
		pageList.setFirstPage(firstPage);
		pageList.setHomePage(getXmlFormat() + ".index");
	}
	return pageList;
}
 
Example 7
Project: unitimes   File: EventImport.java   View Source Code Vote up 5 votes
private void elementRelatedCourses(Element element, CourseEvent event) throws Exception {
		String relatedCoursesElementName = "relatedCourses";
        for ( Iterator<?> it = element.elementIterator(relatedCoursesElementName); it.hasNext(); ) {
            Element relatedCoursesElement = (Element) it.next();
            for( Iterator<?> courseIt = relatedCoursesElement.elementIterator(courseElementName); courseIt.hasNext(); ){
            	elementCourse((Element)courseIt.next(), event);
            }    
         }
//        if (event.getMeetings() == null || event.getMeetings().size() == 0){
//        	throw(new Exception(relatedCoursesElementName + " element must contain at least one " + meetingElementName + " element"));
//        }
	}
 
Example 8
Project: unitimes   File: StudentGroupInfo.java   View Source Code Vote up 5 votes
public ClassInfo(Element e) {
	iClassId = Long.valueOf(e.attributeValue("id"));
	String configId = e.attributeValue("configId");
	iConfigId = (configId == null ? null : Long.valueOf(configId));
	String offeringId = e.attributeValue("offeringId");
	iOfferingId = (offeringId == null ? null : Long.valueOf(offeringId));
	for (Iterator i = e.elementIterator("student"); i.hasNext(); ) {
		iStudents.add(new StudentInfo((Element)i.next()));
	}
}
 
Example 9
Project: parabuild-ci   File: Binder.java   View Source Code Vote up 5 votes
/**
 * Called for Maps
 */
public static void bindMapSecondPass(Element node, Map model, java.util.Map classes, Mappings mappings) throws MappingException {

	bindCollectionSecondPass(node, model, classes, mappings);

	Iterator iter = node.elementIterator();
	while( iter.hasNext() ) {
		Element subnode = (Element) iter.next();
		String name = subnode.getName();

		if ( "index".equals(name) ) {
			SimpleValue value = new SimpleValue( model.getCollectionTable() );
			bindSimpleValue(subnode, value, model.isOneToMany(), IndexedCollection.DEFAULT_INDEX_COLUMN_NAME, mappings);
			model.setIndex(value);
			if ( model.getIndex().getType()==null ) {
				throw new MappingException( "map index element must specify a type" + model.getRole() );
			}
		}
		else if ( "index-many-to-many".equals(name) ) {
			ManyToOne mto = new ManyToOne( model.getCollectionTable() );
			bindManyToOne( subnode, mto, IndexedCollection.DEFAULT_INDEX_COLUMN_NAME, model.isOneToMany(), mappings );
			model.setIndex(mto);

		}
		else if ( "composite-index".equals(name) ) {
			Component component = new Component( model.getCollectionTable() );
			bindComponent(subnode, component, null, model.getRole(), "index", model.isOneToMany(), mappings);
			model.setIndex(component);
		}
		else if ( "index-many-to-any".equals(name) ) {
			Any any = new Any( model.getCollectionTable() );
			bindAny( subnode, any, model.isOneToMany(), mappings );
			model.setIndex(any);
		}
	}

}
 
Example 10
Project: unitimes   File: PropertiesInfo.java   View Source Code Vote up 5 votes
public void load(Element root) {
	clear();
	int version = Integer.parseInt(root.attributeValue("version"));
	if (version==1) {
		for (Iterator i=root.elementIterator("entry");i.hasNext();) {
			Element el = (Element)i.next();
			setProperty(el.attributeValue("key"),el.getText());
		}
	}
}
 
Example 11
Project: unitimes   File: DoubleVarcharSizes.java   View Source Code Vote up 5 votes
public void generate() throws IOException, DocumentException {
	Document document = read(iConfig);
	Element root = document.getRootElement();
	Element sessionFactoryElement = root.element("session-factory");
	for (Iterator<Element> i = sessionFactoryElement.elementIterator("mapping"); i.hasNext(); ) {
		Element m = i.next();
		String resource = m.attributeValue("resource");
		if (resource == null) continue;
		generate(read(resource).getRootElement(), null);
	}
}
 
Example 12
Project: unitimes   File: ExamConflictStatisticsInfo.java   View Source Code Vote up 5 votes
public void load(Element root) {
	int version = Integer.parseInt(root.attributeValue("version"));
	if (version==sVersion) {
		iVariables.clear();
		for (Iterator i1=root.elementIterator("var");i1.hasNext();) {
			CBSVariable var = new CBSVariable((Element)i1.next());
			iVariables.put(new Long(var.getId()),var);
		}
	}
}
 
Example 13
Project: unitimes   File: BaseCourseOfferingImport.java   View Source Code Vote up 5 votes
private HashMap<String, Vector<Calendar>> elementDates(Element element) throws Exception {
	Vector<Calendar> startDates = new Vector<Calendar>();
	Vector<Calendar> endDates = new Vector<Calendar>();
	String elementName = "date";
       if(element.element(elementName) != null){
       	for (Iterator<?> it = element.elementIterator(elementName); it.hasNext();){
			Element dateElement = (Element) it.next();
			Calendar startDate = null;
			Calendar endDate = null;
			if(dateFormat == null) {								
				startDate = getCalendarForDate(getRequiredStringAttribute(dateElement, "startDate", elementName));
				endDate = getCalendarForDate(getRequiredStringAttribute(dateElement, "endDate", elementName));;
			} else {
				startDate = Calendar.getInstance();
				startDate.setTime(CalendarUtils.getDate(getRequiredStringAttribute(dateElement, "startDate", elementName), dateFormat));
				endDate = Calendar.getInstance();
				endDate.setTime(CalendarUtils.getDate(getRequiredStringAttribute(dateElement, "endDate", elementName), dateFormat));
			}
			if (startDate == null){
				throw new Exception("For element 'date' a 'startDate' is required, unable to parse given date");
			}
			if (endDate == null){
				throw new Exception("For element 'date' a 'endDate' is required, unable to parse given date");
			}				
			if (endDate.before(startDate)){
				endDate.add(Calendar.YEAR, 1);
			}
			startDates.add(startDate);
			endDates.add(endDate);				
		}
       }
       if (startDates.size() > 0){
       	HashMap<String, Vector<Calendar>> dates = new HashMap<String, Vector<Calendar>>();
       	dates.put("startDates", startDates);
       	dates.put("endDates", endDates);
       	return(dates);
       } else {
       	return(null);
       }
}
 
Example 14
Project: SimpleController   File: DatabaseXmlReader.java   View Source Code Vote up 5 votes
public MappingDescriptor readConfiguration(String fileAddress){
    MappingDescriptor mappingDescriptor=new MappingDescriptor();
    Document document = readXml(fileAddress);
    Element rootElement=document.getRootElement();
    for(Iterator<Element> i=rootElement.elementIterator("class");i.hasNext();){
        Element classElement =  i.next();
        MappingDescriptor.ClassDescriptor classDescriptor=new MappingDescriptor.ClassDescriptor();
        classDescriptor.setClassAttribute(readClassAttribute(classElement.attributes()));
        classDescriptor.setId(readId(classElement.element("id")));
        classDescriptor.setProperties(readProperties(classElement.elements("property")));
        mappingDescriptor.setClassDescriptor(classDescriptor);
    }
    return mappingDescriptor;
}
 
Example 15
Project: parabuild-ci   File: Configuration.java   View Source Code Vote up 5 votes
private void addProperties(Element parent) {
	Iterator iter = parent.elementIterator("property");
	while ( iter.hasNext() ) {
		Element node = (Element) iter.next();
		String name = node.attributeValue("name");
		String value = node.getText().trim();
		log.debug(name + "=" + value);
		properties.setProperty(name, value);
		if ( !name.startsWith("hibernate") ) properties.setProperty("hibernate." + name, value);
	}
	Environment.verifyProperties(properties);
}
 
Example 16
Project: unitimes   File: EventImport.java   View Source Code Vote up 4 votes
@Override
public void loadXml(Element rootElement) throws Exception {
	trimLeadingZerosFromExternalId = ApplicationProperty.DataExchangeTrimLeadingZerosFromExternalIds.isTrue();
	int loadedCount = 0;
	int recordCount = 0;
	try {
		String rootElementName = "events";
        if (!rootElement.getName().equalsIgnoreCase(rootElementName)) {
        	throw new Exception("Given XML file is not a Events load file.");
        }
        academicInitiative = getRequiredStringAttribute(rootElement, "academicInitiative", rootElementName);
        dateFormat = getOptionalStringAttribute(rootElement, "dateFormat");
        timeFormat = getOptionalStringAttribute(rootElement, "timeFormat");
        String created = getOptionalStringAttribute(rootElement, "created");
        if(timeFormat == null){
        	timeFormat = "HHmm";
        }
        
        beginTransaction();

        if (session == null){
        	// Use the session for the academicInitiative that is effective for events now as the session to use for logging changes
        	session = findDefaultSession(academicInitiative, new Date());
        }
        if (created != null) {
	        addNote("Loading Events XML file created on: " + created);
			ChangeLog.addChange(getHibSession(), getManager(), session, session, created, ChangeLog.Source.DATA_IMPORT_EVENTS, ChangeLog.Operation.CREATE, null, null);
			updateChangeList(true);
        }
        for ( Iterator<?> it = rootElement.elementIterator(); it.hasNext(); ) {
            Element element = (Element) it.next();
            Event event = null;
            if(!element.getName().equalsIgnoreCase(specialEventElementName) && !element.getName().equalsIgnoreCase(courseRelatedEventElementName) ){
            	throw new Exception("Expecting to find a '" + specialEventElementName + "' or a '" + courseRelatedEventElementName + "' at this level, instead found '" + element.getName() + "'.");
            }
            if (element.getName().equalsIgnoreCase(specialEventElementName)){            	
            	event = elementSpecialEvent(element);
            } else if (element.getName().equalsIgnoreCase(courseRelatedEventElementName)){            	
            	event = elementCourseRelatedEvent(element);
            }
            
            if (event != null){
            	loadedCount++;
            }
            recordCount++;
        	flushIfNeeded(true);
        	updateChangeList(true);
        }
        commitTransaction();
	} catch (Exception e) {
		fatal("Exception: " + e.getMessage(), e);
		rollbackTransaction();
		throw e;
	}	
	addNote("Events Added: " + loadedCount + " of " + recordCount + " possible events.");
	updateChangeList(true);
	reportMissingLocations();
	mailLoadResults();
}
 
Example 17
Project: unitimes   File: LastLikeCourseDemandImport.java   View Source Code Vote up 4 votes
private void loadCourses(Element studentEl, Student student, Session session) throws Exception {
	int row = 0;
	for (Iterator it = studentEl.elementIterator(); it.hasNext();) {
		Element el = (Element) it.next();
		String subject = getOptionalStringAttribute(el, "subject");
		String courseNumber = getOptionalStringAttribute(el, "courseNumber");
		String externalIdStr = getOptionalStringAttribute(el, "externalId");
		if (externalIdStr == null){
			if (subject == null || courseNumber == null){
				throw new Exception("Either a Subject and Course Number is required or an External Id is required.");
			}
		}
		SubjectArea area = null;
		String permId = null;
		if (externalIdStr != null){
			area = externalIdSubjectArea.get(externalIdStr);
			courseNumber = externalIdCourseNumber.get(externalIdStr);
			permId = externalIdCoursePermId.get(externalIdStr);
			if(area == null) {
				warn("Course not found " + externalIdStr + " not found");
				continue;
			}
		} else {
			area = subjectAreas.get(subject);
			if(area == null) {
				warn("Subject area " + subject + " not found");
				continue;
			}
			permId = courseOfferings.get(courseNumber + area.getUniqueId().toString());
		}

        LastLikeCourseDemand demand = new LastLikeCourseDemand();

		demand.setCoursePermId(permId);

		demand.setCourseNbr(courseNumber);
        demand.setStudent(student);
        demand.setSubjectArea(area);
        demand.setPriority(Integer.decode(el.attributeValue("priority", String.valueOf(row++))));
        getHibSession().save(demand);
	}
}
 
Example 18
Project: unitimes   File: BaseCourseOfferingImport.java   View Source Code Vote up 4 votes
protected ArrayList<ImportCourseOffering> getCourses(Element element) throws Exception {
	ArrayList<ImportCourseOffering> courses = new ArrayList<ImportCourseOffering>();
	String elementName = "course";
	if(element.element(elementName) != null) {
		for (Iterator<?> it = element.elementIterator(elementName); it.hasNext();){
			Element courseElement = (Element) it.next();
			
			String externalUid = getOptionalStringAttribute(courseElement, "id");
			Boolean controlling  = getRequiredBooleanAttribute(courseElement, "controlling", elementName);
			String courseNbr = getRequiredStringAttribute(courseElement, "courseNbr", elementName);
			String scheduleBookNote = getOptionalStringAttribute(courseElement, "scheduleBookNote");
			String subjAbbv = getRequiredStringAttribute(courseElement, "subject", elementName);
			SubjectArea subjectArea = subjectAreas.get(subjAbbv);
			String title = getOptionalStringAttribute(courseElement, "title");
			CourseOffering newCourseOffering = new CourseOffering();
			newCourseOffering.setSubjectArea(subjectArea);
			if (courseNbr != null && courseNbr.trim().length() > 0){
				newCourseOffering.setCourseNbr(courseNbr.trim());
			}
			if(externalUid != null && externalUid.trim().length() > 0){
				newCourseOffering.setExternalUniqueId(externalUid.trim());
			}
			newCourseOffering.setIsControl(controlling);
			if (scheduleBookNote != null && scheduleBookNote.trim().length() > 0){
				newCourseOffering.setScheduleBookNote(scheduleBookNote.trim());
			}
			if (title != null && title.trim().length() > 0){
				newCourseOffering.setTitle(title.trim());
			}
			
			Element consentElement = courseElement.element("consent");
			if (consentElement == null)
				consentElement = element.element("consent");
			if (consentElement != null) { // no consent on course -- try to take consent from the parent (offering)
				String consentType = getRequiredStringAttribute(consentElement, "type", "consent");
				newCourseOffering.setConsentType(OfferingConsentType.getOfferingConsentTypeForReference(consentType));
			}

			String reserved = getOptionalStringAttribute(courseElement, "reserved");
			if (reserved != null) {
				try {
					newCourseOffering.setReservation(Integer.parseInt(reserved));
				} catch (NumberFormatException e) {}
			}
			
			elementCourseCredit(courseElement, newCourseOffering);
			
			ImportCourseOffering importcourseOffering = new ImportCourseOffering(newCourseOffering, courseElement);
			courses.add(importcourseOffering);
		}
	} else {
		throw new Exception("'course' element is required.");
	}

	return(courses);
}
 
Example 19
Project: lams   File: HbmBinder.java   View Source Code Vote up 4 votes
private static void makeIdentifier(Element node, SimpleValue model, Mappings mappings) {

		// GENERATOR
		Element subnode = node.element( "generator" );
		if ( subnode != null ) {
			final String generatorClass = subnode.attributeValue( "class" );
			model.setIdentifierGeneratorStrategy( generatorClass );

			Properties params = new Properties();
			// YUCK!  but cannot think of a clean way to do this given the string-config based scheme
			params.put( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer() );

			if ( mappings.getSchemaName() != null ) {
				params.setProperty(
						PersistentIdentifierGenerator.SCHEMA,
						mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( mappings.getSchemaName() )
				);
			}
			if ( mappings.getCatalogName() != null ) {
				params.setProperty(
						PersistentIdentifierGenerator.CATALOG,
						mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( mappings.getCatalogName() )
				);
			}

			Iterator iter = subnode.elementIterator( "param" );
			while ( iter.hasNext() ) {
				Element childNode = (Element) iter.next();
				params.setProperty( childNode.attributeValue( "name" ), childNode.getTextTrim() );
			}

			model.setIdentifierGeneratorProperties( params );
		}

		model.getTable().setIdentifierValue( model );

		// ID UNSAVED-VALUE
		Attribute nullValueNode = node.attribute( "unsaved-value" );
		if ( nullValueNode != null ) {
			model.setNullValue( nullValueNode.getValue() );
		}
		else {
			if ( "assigned".equals( model.getIdentifierGeneratorStrategy() ) ) {
				model.setNullValue( "undefined" );
			}
			else {
				model.setNullValue( null );
			}
		}
	}
 
Example 20
Project: joai-project   File: XMLQueryParser.java   View Source Code Vote up 4 votes
private static Query makeBooleanQuery(Element booleanQueryElement, QueryParser queryParser) throws Exception {
	String operator = booleanQueryElement.valueOf("@type");

	boolean isRequired = false;
	boolean isProhibited = false;

	if (operator == null)
		throw new Exception("Error parsing document: element <booleanQuery> must contain an attribite named 'type' that contains the value 'AND' or 'OR'. Error found at " + booleanQueryElement.getUniquePath());
	else if (operator.equalsIgnoreCase("OR"))
		isRequired = false;
	else if (operator.equalsIgnoreCase("AND"))
		isRequired = true;
	else
		throw new Exception("Error parsing document: element <booleanQuery> must contain an attribite named 'type' that contains the value 'AND' or 'OR' but value '" + operator + "' was found. Error found at " + booleanQueryElement.getUniquePath());

	BooleanQuery booleanQuery = new BooleanQuery();

	// iterate through child elements of booleanClause
	Query query = null;
	for (Iterator i = booleanQueryElement.elementIterator(); i.hasNext(); ) {
		Element element = (Element) i.next();

		// Exclude from results or require (overrides previous boolean designation)?
		String excludeOrRequire = element.attributeValue("excludeOrRequire");
		if (excludeOrRequire != null) {
			excludeOrRequire = excludeOrRequire.trim();
			if (excludeOrRequire.equalsIgnoreCase("exclude")) {
				isRequired = false;
				isProhibited = true;
			}
			else if (excludeOrRequire.equalsIgnoreCase("require")) {
				isRequired = true;
				isProhibited = false;
			}
			else if (excludeOrRequire.equalsIgnoreCase("neither")) {
				isRequired = false;
				isProhibited = false;
			}
			else {
				throw new Exception("Error parsing document: the value of attribute excludeOrRequire must be one of 'exclude', 'require' or 'neither' but '"
					 + excludeOrRequire + "' was found at " + booleanQueryElement.getUniquePath());
			}
		}

		if (element.getName().equals("booleanQuery")) {
			query = makeBooleanQuery(element, queryParser);
			if (query != null) {
				if (isRequired && !isProhibited)
					booleanQuery.add(query, BooleanClause.Occur.MUST);
				else if (!isRequired && isProhibited)
					booleanQuery.add(query, BooleanClause.Occur.MUST_NOT);
				else
					booleanQuery.add(query, BooleanClause.Occur.SHOULD);
			}
		}
		else {
			query = makeLuceneQuery(element, queryParser);
			if (query != null) {
				if (isRequired && !isProhibited)
					booleanQuery.add(query, BooleanClause.Occur.MUST);
				else if (!isRequired && isProhibited)
					booleanQuery.add(query, BooleanClause.Occur.MUST_NOT);
				else
					booleanQuery.add(query, BooleanClause.Occur.SHOULD);
			}
		}
	}

	return applyBoost(booleanQueryElement, booleanQuery);
}