當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。