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


Java Element.attributeValue方法代码示例

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


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

示例1: parse

import org.dom4j.Element; //导入方法依赖的package包/类
public Object parse(Element element,long processId,boolean parseChildren) {
	EndNode node=new EndNode();
	node.setProcessId(processId);
	parseNodeCommonInfo(element, node);
	String terminate=element.attributeValue("terminate");
	if(StringUtils.isNotEmpty(terminate)){
		node.setTerminate(Boolean.valueOf(terminate));
	}
	NodeDiagram diagram=parseDiagram(element);
	if(node.isTerminate()){
		diagram.setIcon("/icons/end-terminate.svg");
	}else{
		diagram.setIcon("/icons/end.svg");
	}
	diagram.setShapeType(ShapeType.Circle);
	diagram.setBorderWidth(1);
	node.setDiagram(diagram);
	return node;
}
 
开发者ID:youseries,项目名称:uflo,代码行数:20,代码来源:EndParser.java

示例2: CBSVariable

import org.dom4j.Element; //导入方法依赖的package包/类
CBSVariable(Element element) {
	iExamId = Long.parseLong(element.attributeValue("exam"));
	iName = element.attributeValue("name");
	iPref = element.attributeValue("pref");
	for (Iterator i=element.elementIterator("val");i.hasNext();)
		iValues.add(new CBSValue(this,(Element)i.next())); 
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:8,代码来源:ExamConflictStatisticsInfo.java

示例3: findClassNames

import org.dom4j.Element; //导入方法依赖的package包/类
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 );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:Configuration.java

示例4: replaceManifestApplicationName

import org.dom4j.Element; //导入方法依赖的package包/类
/**
 * Replace the original application in the manifest nameFor AtlasBridgeApplication
 * The original name has been written in meta-data
 */
private static void replaceManifestApplicationName(Document document) {
    // Write meta-data information
    Element root = document.getRootElement();// Get the root node
    Element applicationElement = root.element("application");
    String realApplicationClassName = applicationElement.attributeValue("name");

    if (null == realApplicationClassName) {
        realApplicationClassName = "";
    }

    applicationElement.addAttribute(StringUtils.isEmpty(realApplicationClassName) ? "android:name" : "name",
                                    "android.taobao.atlas.startup.AtlasBridgeApplication");

    Element metaData = applicationElement.addElement("meta-data");
    metaData.addAttribute("android:name", "REAL_APPLICATION");
    metaData.addAttribute("android:value", realApplicationClassName);
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:22,代码来源:ManifestFileUtils.java

示例5: parse

import org.dom4j.Element; //导入方法依赖的package包/类
public Object parse(Element element,long processId,boolean parseChildren) {
	SequenceFlowImpl flow=new SequenceFlowImpl();
	flow.setProcessId(processId);
	flow.setName(unescape(element.attributeValue("name")));
	flow.setToNode(unescape((element.attributeValue("to"))));
	String conditionType=element.attributeValue("condition-type");
	if(StringUtils.isNotEmpty(conditionType)){
		flow.setConditionType(ConditionType.valueOf(conditionType));			
		flow.setExpression(element.attributeValue("expression"));
		flow.setHandlerBean(element.attributeValue("handler-bean"));
	}
	flow.setDiagram(parseDiagram(element));
	String g=element.attributeValue("g");
	if(StringUtils.isNotBlank(g)){
		int pos=g.indexOf(":");
		if(pos>-1){
			g=g.substring(0,pos);
			g=g.replaceAll(";", ",");
		}else{
			g=null;
		}
	}
	flow.setG(g);
	return flow;
}
 
开发者ID:youseries,项目名称:uflo,代码行数:26,代码来源:SequenceFlowParser.java

示例6: buildQueryHints

import org.dom4j.Element; //导入方法依赖的package包/类
private static void buildQueryHints(List<Element> elements, AnnotationDescriptor ann){
	List<QueryHint> queryHints = new ArrayList<QueryHint>( elements.size() );
	for ( Element hint : elements ) {
		AnnotationDescriptor hintDescriptor = new AnnotationDescriptor( QueryHint.class );
		String value = hint.attributeValue( "name" );
		if ( value == null ) {
			throw new AnnotationException( "<hint> without name. " + SCHEMA_VALIDATION );
		}
		hintDescriptor.setValue( "name", value );
		value = hint.attributeValue( "value" );
		if ( value == null ) {
			throw new AnnotationException( "<hint> without value. " + SCHEMA_VALIDATION );
		}
		hintDescriptor.setValue( "value", value );
		queryHints.add( (QueryHint) AnnotationFactory.create( hintDescriptor ) );
	}
	ann.setValue( "hints", queryHints.toArray( new QueryHint[queryHints.size()] ) );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:JPAOverriddenAnnotationReader.java

示例7: hasMultiSelect

import org.dom4j.Element; //导入方法依赖的package包/类
/**
 *  multiselect iff
 *  <ul>
 *    <li> isComplex</li>
 *    <li> hasSequenceCompositor</li>
 *    <ul>
 *      <li> containing a single multiSelect element</li>
 *    </ul>
 *
 *  </ul>
 *
 *
 * @param  schemaNode  NOT YET DOCUMENTED
 * @return             NOT YET DOCUMENTED
 */
public boolean hasMultiSelect(SchemaNode schemaNode) {
	// prtln ("\nhasMultiSelect()");
	// prtln ("schemaNode: " + schemaNode.toString());
	if (!schemaNode.isElement()) {
		return false;
	}

	GlobalDef typeDef = getGlobalDef(schemaNode);
	if (typeDef == null) {
		// prtln(" ... unable to find type def for " + schemaNode.getDataTypeName());
		return false;
	}
	if (!typeDef.isComplexType()) {
		// prtln(" ... is not complexType");
		return false;
	}

	ComplexType cType = (ComplexType) typeDef;
	if (cType.getCompositorType() == Compositor.SEQUENCE) {
		List seqNodes = cType.getElement().selectNodes(NamespaceRegistry.makeQualifiedName(cType.getXsdPrefix(), "sequence") + "/*");
		if (seqNodes.size() != 1) {
			// prtln(" ... more than one sequence elements found - returning false");
			return false;
		}

		// There is only one element contained in the sequence. If this elsment is an enumeration
		// then return true ...
		Element seqElement = (Element) seqNodes.get(0);
		String typeName = seqElement.attributeValue("type");
		return isEnumerationType(typeName);
	}
	else {
		// prtln(" ... non-sequence compositor - returning false");
		return false;
	}
}
 
开发者ID:NCAR,项目名称:joai-project,代码行数:52,代码来源:SchemaHelper.java

示例8: contain

import org.dom4j.Element; //导入方法依赖的package包/类
public boolean contain(String path, String xml) {
	try{
		Document doc=DocumentHelper.parseText(xml);
		Element element=doc.getRootElement();
		for(Object obj:element.elements()){
			if(!(obj instanceof Element)){
				continue;
			}
			Element ele=(Element)obj;
			String name=ele.getName();
			boolean match=false;
			if(name.equals("import-variable-library")){
				match=true;
			}else if(name.equals("import-constant-library")){
				match=true;
			}else if(name.equals("import-action-library")){
				match=true;
			}else if(name.equals("import-parameter-library")){
				match=true;
			}
			if(!match){
				continue;
			}
			String filePath=ele.attributeValue("path");
			if(filePath.endsWith(path)){
				return true;
			}
		}
		return false;
	}catch(Exception ex){
		throw new RuleException(ex);
	}
}
 
开发者ID:youseries,项目名称:urule,代码行数:34,代码来源:FlowDefinitionReferenceUpdater.java

示例9: toJpdl

import org.dom4j.Element; //导入方法依赖的package包/类
public JpdlInfo toJpdl(Element element) {
	BaseElement targetElement=new BaseElement("transition");
	String name=this.buildCommonJpdlElement(element, targetElement);
	String fromShapeLabel=element.attributeValue("fromShapeLabel");
	String toShapeLabel=element.attributeValue("toShapeLabel");
	targetElement.addAttribute("to", toShapeLabel);
	targetElement.addAttribute("fromShapeLabel", fromShapeLabel);
	JpdlInfo info=new JpdlInfo();
	info.setName(name);
	info.setElement(targetElement);
	return info;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:13,代码来源:TransitionConverter.java

示例10: lookupDepartment

import org.dom4j.Element; //导入方法依赖的package包/类
protected Department lookupDepartment(Element element) {
	if (iDepartments == null)
		iDepartments = (List<Department>)getHibSession().createQuery(
     		"select distinct d from Department d left join fetch d.preferences p where d.session.uniqueId = :sessionId")
     		.setLong("sessionId", iSession.getUniqueId()).list();
	String deptCode = element.attributeValue("code", "not-set");
	for (Iterator<Department> i = iDepartments.iterator(); i.hasNext(); ) {
		Department department = i.next();
		if (deptCode.equals(department.getDeptCode())) { return department; }
	}
	warn("Department " + deptCode + " does not exist.");
	return null;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:14,代码来源:PreferencesImport.java

示例11: getAssociationId

import org.dom4j.Element; //导入方法依赖的package包/类
/**
 * Adds an @Id annotation to the specified annotationList if the specified element has the id
 * attribute set to true. This should only be the case for many-to-one or one-to-one
 * associations.
 */
private void getAssociationId(List<Annotation> annotationList, Element element) {
	String attrVal = element.attributeValue( "id" );
	if ( "true".equals( attrVal ) ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( Id.class );
		annotationList.add( AnnotationFactory.create( ad ) );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:JPAOverriddenAnnotationReader.java

示例12: getOptionalStringAttribute

import org.dom4j.Element; //导入方法依赖的package包/类
protected String getOptionalStringAttribute(Element element, String attributeName) {		
	String attributeValue = element.attributeValue(attributeName);
	if (attributeValue == null || attributeValue.trim().length() == 0){
		attributeValue = null;
	} else {
		attributeValue = attributeValue.trim().replace('\u0096', ' ').replace('\u0097', ' ');
	}						
	return(attributeValue);		
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:10,代码来源:BaseImport.java

示例13: bindClass

import org.dom4j.Element; //导入方法依赖的package包/类
public static void bindClass(Element node, PersistentClass persistentClass, Mappings mappings,
		java.util.Map inheritedMetas) throws MappingException {
	// transfer an explicitly defined entity name
	// handle the lazy attribute
	Attribute lazyNode = node.attribute( "lazy" );
	boolean lazy = lazyNode == null ?
			mappings.isDefaultLazy() :
			"true".equals( lazyNode.getValue() );
	// go ahead and set the lazy here, since pojo.proxy can override it.
	persistentClass.setLazy( lazy );

	String entityName = node.attributeValue( "entity-name" );
	if ( entityName == null ) entityName = getClassName( node.attribute("name"), mappings );
	if ( entityName==null ) {
		throw new MappingException( "Unable to determine entity name" );
	}
	persistentClass.setEntityName( entityName );
	persistentClass.setJpaEntityName( StringHelper.unqualify( entityName ) );

	bindPojoRepresentation( node, persistentClass, mappings, inheritedMetas );
	bindDom4jRepresentation( node, persistentClass, mappings, inheritedMetas );
	bindMapRepresentation( node, persistentClass, mappings, inheritedMetas );

	Iterator itr = node.elementIterator( "fetch-profile" );
	while ( itr.hasNext() ) {
		final Element profileElement = ( Element ) itr.next();
		parseFetchProfile( profileElement, mappings, entityName );
	}

	bindPersistentClassCommonValues( node, persistentClass, mappings, inheritedMetas );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:HbmBinder.java

示例14: fromXml

import org.dom4j.Element; //导入方法依赖的package包/类
public static BtbInstructorInfo fromXml(Element element) {
	BtbInstructorInfo s = new BtbInstructorInfo();
	if (element.element("first")!=null)
		s.iFirst = Hint.fromXml(element.element("first"));
	if (element.element("second")!=null)
		s.iSecond = Hint.fromXml(element.element("second"));
	s.iPref = Integer.parseInt(element.attributeValue("pref"));
	s.iInsturctor = element.attributeValue("instructor");
	return s;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:11,代码来源:Suggestion.java

示例15: parseFields

import org.dom4j.Element; //导入方法依赖的package包/类
private List<Field> parseFields(Element element){
	List<Field> fields=new ArrayList<Field>();
	for(Object obj:element.elements()){
		if(obj==null || !(obj instanceof Element)){
			continue;
		}
		Element ele=(Element)obj;
		if(!ele.getName().equals("field")){
			continue;
		}
		Field field=new Field(ele.attributeValue("name"));
		fields.add(field);
	}
	return fields;
}
 
开发者ID:youseries,项目名称:ureport,代码行数:16,代码来源:DatasourceParser.java


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