• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JDOMXPath类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jaxen.jdom.JDOMXPath的典型用法代码示例。如果您正苦于以下问题:Java JDOMXPath类的具体用法?Java JDOMXPath怎么用?Java JDOMXPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JDOMXPath类属于org.jaxen.jdom包,在下文中一共展示了JDOMXPath类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getClassDescendents

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
/**
 * Adds to the descendents list all the descendents parentClass descendents
 * 
 * @param parentClass the class data from which we want to the descendents
 * @param descendents the list which the descendets will the be added to
 */
private static void getClassDescendents(Element parentClass, List<Element> descendents){
	List result = null;
	try {
		XPath path = new JDOMXPath("class[generalization/@element='class' and generalization/@id='"
				+ parentClass.getAttributeValue("id") + "']");
		result = path.selectNodes(parentClass.getParentElement());
	} catch (JaxenException e) {			
		e.printStackTrace();
	}
	
	for (Iterator iter = result.iterator(); iter.hasNext();) {
		Element child = (Element) iter.next();
		descendents.add(child);
		getClassDescendents(child, descendents);
	}

}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:24,代码来源:XMLUtilities.java


示例2: getClassesHierarchyTree

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
/**
 * Adds to the descendents list all the descendents parentClass descendents
 * 
 * @param parentClass the class data from which we want to the descendents
 * @param descendents the list which the descendets will the be added to
 */
public static Element getClassesHierarchyTree(Element project){
	Element tree = new Element("hierarchy");
	
	List classes = null;
	try {
		XPath path = new JDOMXPath("project/elements/classes/class[stereotype!='utility' and type!='Primitive' and generalization[@id='']]");
		classes = path.selectNodes(project.getDocument());
	} catch (JaxenException e) {			
		e.printStackTrace();
	}
	
	for(Iterator iter = classes.iterator(); iter.hasNext();){
		Element currentClass = (Element)iter.next();
		
		Element highClassTree = getClassDescendenceTree(currentClass);
		tree.addContent(highClassTree);
	}
	return tree;
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:26,代码来源:XMLUtilities.java


示例3: getClassDescendenceTree

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
private static Element getClassDescendenceTree(Element child) {
	Element highClass = new Element("class");
	highClass.setAttribute("name", child.getChildText("name"));
	highClass.setAttribute("id", child.getAttributeValue("id"));
	
	List result = null;
	try {
		XPath path = new JDOMXPath("class[generalization/@element='class' and generalization/@id='"
				+ child.getAttributeValue("id") + "']");
		result = path.selectNodes(child.getParentElement());
	} catch (JaxenException e) {			
		e.printStackTrace();
	}
	
	for (Iterator iterator = result.iterator(); iterator.hasNext();) {
		Element grandchild = (Element) iterator.next();				
		Element grandchildTree = getClassDescendenceTree(grandchild);
		highClass.addContent(grandchildTree);
	}
	
	return highClass;
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:23,代码来源:XMLUtilities.java


示例4: setUseCaseConstraintPane

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
private void setUseCaseConstraintPane(){
	Element definition = null;
	try {
		XPath path = new JDOMXPath("definition");
		definition = (Element)path.selectSingleNode(data);
	} catch (JaxenException e2) {			
		e2.printStackTrace();
	}
	
	if(definition != null){
	
		String preConditionText = definition.getChildText("precondition");
		useCasePreTextPane.setText(preConditionText);
	
		String posConditionText = definition.getChildText("postcondition");
		useCasePosTextPane.setText(posConditionText);
	
		String invariantText = definition.getChildText("invariants");
		useCaseInvTextPane.setText(invariantText);
	
		String temporalConstraintText = definition.getChildText("temporalConstraints");
		useCaseTempTextPane.setText(temporalConstraintText);
	}
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:25,代码来源:PropertiesTabbedPane.java


示例5: setUseCaseFurtherDetailsPane

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
private void setUseCaseFurtherDetailsPane(){
	Element definition = null;
	try {
		XPath path = new JDOMXPath("definition");
		definition = (Element)path.selectSingleNode(data);
	} catch (JaxenException e2) {			
		e2.printStackTrace();
	}
	if(definition != null){
		String preConditionText = definition.getChildText("additionalIformation");
		useCaseInfoTextPane.setText(preConditionText);
	
		String posConditionText = definition.getChildText("issues");
		useCaseIssueTextPane.setText(posConditionText);
	}
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:17,代码来源:PropertiesTabbedPane.java


示例6: getSubClasses

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public void getSubClasses(Element Class, ArrayList<Element> list){
	
	if (Class != null){

			List<?> result = null;
			try {
				XPath path = new JDOMXPath("project/elements/classes/class[generalization/@id='"+Class.getAttributeValue("id")+"']");
				result = path.selectNodes(data.getDocument());
			} catch (JaxenException e2) {			
				e2.printStackTrace();
			}
			
			for (int i = 0; i < result.size(); i++){
				Element subClass = (Element)result.get(i);
				list.add(subClass);
				getSubClasses(subClass,list);
			}		
	}
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:20,代码来源:PropertiesTabbedPane.java


示例7: getSuperClasses

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public void getSuperClasses(Element Class, ArrayList<Element> list){
	
	if (Class != null){
			Element generalization = Class.getChild("generalization");
			if (!generalization.getAttributeValue("id").trim().equals("")){
				Element superClass = null;
				try {
					XPath path = new JDOMXPath("project/elements/classes/class[@id='"+generalization.getAttributeValue("id")+"']");
					superClass = (Element)path.selectSingleNode(data.getDocument());
				} catch (JaxenException e2) {			
					e2.printStackTrace();
				}
				if (superClass != null){
					list.add(superClass);
					getSubClasses(superClass,list);
				}	
				
			}	
	}
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:21,代码来源:PropertiesTabbedPane.java


示例8: showParameter

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
private void showParameter(Element parameter) {

		//DefaultTableModel tableModel = new DefaultTableModel();
		//tableModel = (DefaultTableModel)parametersTable.getModel();
		
		Vector<String> attRow = new Vector<String>();		
		attRow.add(parameter.getChildText("name"));
		
		Element typeClass = null;
		try {
			XPath path = new JDOMXPath("project/elements/classes/*[@id='"+parameter.getChildText("type")+"']");
			typeClass = (Element)path.selectSingleNode(parameter.getDocument());
		} catch (JaxenException e2) {			
			e2.printStackTrace();
		}
		if (typeClass != null){
			attRow.add(typeClass.getChildText("name"));		
		}
		else{
			attRow.add("");	
		}		
		parametersTableModel.addRow(attRow);			
	}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:24,代码来源:EditDialog.java


示例9: getNameAssociations

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public ArrayList<Object> getNameAssociations(String classe){
    
       ArrayList<Object> name_associations = new ArrayList<Object>();
       List<?> result = null;
       List<?> list_asso_end = null;

       try {
           XPath path = new JDOMXPath("project/elements/classAssociations/classAssociation");
           result = path.selectNodes(diagram.getDocument());
} catch (JaxenException e2) {			
       }
       
       for(int i = 0; i < result.size(); i++){ 
           Element association = (Element)result.get(i);     
           Element ass_ends = association.getChild("associationEnds");
           String name = association.getChildText("name");
           list_asso_end = ass_ends.getChildren("associationEnd");   
           String second_ass = ((Element)list_asso_end.get(1)).getAttributeValue("element-id");             
           //First store a association name
           if(second_ass.equals(classe)){
               name_associations.add(name);                
           }
           }
       return name_associations;
       }
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:26,代码来源:ObjectGridWizard.java


示例10: getAssociations

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public ArrayList<Object> getAssociations(){
   
       ArrayList<Object> name_associations = new ArrayList<Object>();
       
       List<?> result = null;
       List<?> list_asso_end = null;

       try {
           XPath path = new JDOMXPath("project/elements/classAssociations/classAssociation");
           result = path.selectNodes(diagram.getDocument());
} catch (JaxenException e2) {			
e2.printStackTrace();
       }
       for(int i = 0; i < result.size(); i++){ 
           Element association = (Element)result.get(i);     
           Element name = association.getChild("name");
           name_associations.add(name.getValue());
       }    
       return name_associations;
      
   }
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:22,代码来源:ObjectGridWizard.java


示例11: getIdClass

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public Object getIdClass(String classe){
   
       ArrayList<Object> associations = new ArrayList<Object>();
       List<?> result = null;
       List<?> list_asso_end = null;

       try {
           XPath path = new JDOMXPath("project/elements/classAssociations/classAssociation");
           result = path.selectNodes(diagram.getDocument());
} catch (JaxenException e2) {			
e2.printStackTrace();
       }
       for(int i = 0; i < result.size(); i++){ 
           Element association = (Element)result.get(i);            
           if(association.getChild("name").getValue().toString().equals(classe)){
               return association.getAttribute("id").getValue();
           }
       }
       return null;
   }
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:21,代码来源:ObjectGridWizard.java


示例12: getNameClass

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public Object getNameClass(String id){
   
       ArrayList<Object> associations = new ArrayList<Object>();
       List<?> result = null;
       List<?> list_asso_end = null;

       try {
           XPath path = new JDOMXPath("project/elements/classes/class");
           result = path.selectNodes(diagram.getDocument());
} catch (JaxenException e2) {			
e2.printStackTrace();
       }
       for(int i = 0; i < result.size(); i++){ 
           Element association = (Element)result.get(i); 
           String temp = association.getAttribute("id").getValue().toString();
           if(temp.equals(id)){
               return association.getChild("name").getValue().toString();
           }
       }
       return null;
   }
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:22,代码来源:ObjectGridWizard.java


示例13: getAssociations

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public ArrayList<Object> getAssociations(){
   
       ArrayList<Object> name_associations = new ArrayList<Object>();
       List<?> result = null;
       List<?> list_asso_end = null;

       try {
           XPath path = new JDOMXPath("project/elements/classAssociations/classAssociation");
           result = path.selectNodes(diagramRepository.getDocument());
} catch (JaxenException e2) {			
e2.printStackTrace();
       }
       for(int i = 0; i < result.size(); i++){ 
           Element association = (Element)result.get(i);     
           Element name = association.getChild("name");
           name_associations.add(name.getValue());
       }    
       return name_associations;
      
   }
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:21,代码来源:AssociateNeighbor.java


示例14: getAssociations

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public ArrayList<Object> getAssociations(){
   
       ArrayList<Object> name_associations = new ArrayList<Object>();
       List<?> result = null;
       List<?> list_asso_end = null;

       try {
           XPath path = new JDOMXPath("project/elements/classAssociations/classAssociation");
           result = path.selectNodes(objectDiagram.getDocument());
} catch (JaxenException e2) {			
e2.printStackTrace();
       }
       for(int i = 0; i < result.size(); i++){ 
           Element association = (Element)result.get(i);     
           Element name = association.getChild("name");
           name_associations.add(name.getValue());
       }    
       return name_associations;
      
   }
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:21,代码来源:AssociateNeighbour3.java


示例15: getAssociationsClass

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public ArrayList<Object> getAssociationsClass(String classe){

        ArrayList<Object> associations = new ArrayList<Object>();
        List<?> result = null;
        List<?> list_asso_end = null;
        
        try {
            XPath path = new JDOMXPath("project/elements/classAssociations/classAssociation");
            result = path.selectNodes(objectDiagram.getDocument());
	} catch (JaxenException e2) {			
	e2.printStackTrace();
        }
        for(int i = 0; i < result.size(); i++){ 
            Element association = (Element)result.get(i);     
            Element ass_ends = association.getChild("associationEnds");             
            list_asso_end = ass_ends.getChildren("associationEnd"); 
            String first_ass = ((Element)list_asso_end.get(0)).getAttributeValue("element-id");
            String second_ass = ((Element)list_asso_end.get(1)).getAttributeValue("element-id");
            
            if(first_ass.equals(classe) || second_ass.equals(classe)){
                associations.add(association.getAttribute("id").getValue());          
            }
           
        }        
        return associations;
    }
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:27,代码来源:AssociateNeighbour3.java


示例16: getIdClass

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public Object getIdClass(String classe){
   
       ArrayList<Object> associations = new ArrayList<Object>();
       List<?> result = null;
       List<?> list_asso_end = null;

       try {
           XPath path = new JDOMXPath("project/elements/classAssociations/classAssociation");
           result = path.selectNodes(objectDiagram.getDocument());
} catch (JaxenException e2) {			
e2.printStackTrace();
       }
       for(int i = 0; i < result.size(); i++){ 
           Element association = (Element)result.get(i);            
           if(association.getChild("name").getValue().toString().equals(classe)){
               return association.getAttribute("id").getValue();
           }
       }
       return null;
   }
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:21,代码来源:AssociateNeighbour3.java


示例17: filloutExistingRolesCombobox

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
private void filloutExistingRolesCombobox(){
       //add classes
       existingRoles.removeAllItems();
//existingRoles.addItem("",null);
List<?> classes =null;
       try {
               XPath path = new JDOMXPath("project/elements/classes/*[type!='Primitive']");
               classes = path.selectNodes(project.getDocument());
       } catch (JaxenException e2) {			
               e2.printStackTrace();
       }
	
       for (Iterator<?> iter = classes.iterator(); iter.hasNext();) {
               Element classNode = (Element) iter.next();			
               existingRoles.addItem(classNode.getChildText("name"),classNode);
       }
   }
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:18,代码来源:ImportModelingPattern.java


示例18: toString

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
public String toString(){
	String str;
	
	Element objectClass = null;
	try {
		XPath path = new JDOMXPath("project/elements/classes/class[@id='"+ 
				data.getChildText("class") +"']");
		objectClass = (Element)path.selectSingleNode(data.getDocument());
	} catch (JaxenException e2) {			
		e2.printStackTrace();
	}
	if(objectClass != null){
		str = data.getChildText("name")+ ": " +objectClass.getChildText("name");
	}
	else{
		str = data.getChildText("name");
	}
	
	return str;
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:21,代码来源:AdditionalPropertiesTabbedPane.java


示例19: repaintOpenDiagrams

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
/**
 * Repaints all objects in an open diagram of the specified type
 * @param diagramType the type of diagrams to be painted
 */
public void repaintOpenDiagrams(String diagramType){
	// get all open repository or object diagrams
               List<?> openDiagrams = null;
               try{
                       XPath path = new JDOMXPath("openTab[type='"+ diagramType +"']");
                       openDiagrams = path.selectNodes(openTabs);
               }
               catch(JaxenException e2){
                       e2.printStackTrace();
               }

               // repaint the elements
               for (Iterator<?> iter = openDiagrams.iterator(); iter
			.hasNext();) {
		Element openTab = (Element) iter.next();
		JRootPane rootPane = (JRootPane)getComponentAt(openTabs.indexOf(openTab));
		ItGraph openGraph = (ItGraph)((JScrollPane)rootPane.getComponent(3)).getViewport().getView();
		openGraph.repaintAllElements();
	}
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:25,代码来源:ItTabbedPane.java


示例20: reBuildOpenDiagrams

import org.jaxen.jdom.JDOMXPath; //导入依赖的package包/类
/**
 * Repaints all objects in an open diagram of the specified type
 * @param diagramType the type of diagrams to be painted
 */
public void reBuildOpenDiagrams(String diagramType){
	// get all open repository or object diagrams
               List<?> openDiagrams = null;
               try{
                       XPath path = new JDOMXPath("openTab[type='"+ diagramType +"']");
                       openDiagrams = path.selectNodes(openTabs);
               }
               catch(JaxenException e2){
               }

               // repaint the elements
               for (Iterator<?> iter = openDiagrams.iterator(); iter
			.hasNext();) {
		Element openTab = (Element) iter.next();
		JRootPane rootPane = (JRootPane)getComponentAt(openTabs.indexOf(openTab));
		ItGraph openGraph = (ItGraph)((JScrollPane)rootPane.getComponent(3)).getViewport().getView();
                       
                       
		//openGraph.removeAll();
                       openGraph.buildDiagram();
                       openGraph.repaintAllElements();;
	}
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:28,代码来源:ItTabbedPane.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobQueueChangeEvent类代码示例发布时间:2022-05-23
下一篇:
Java FromItem类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap