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


Java JDOMException类代码示例

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


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

示例1: getCreoleXML

import org.jdom.JDOMException; //导入依赖的package包/类
@Override
public Document getCreoleXML() throws Exception, JDOMException {
  Document doc = new Document();
  Element element;
  doc.addContent(element = new Element("CREOLE-DIRECTORY"));
  element.addContent(element = new Element("CREOLE"));
  element.addContent(element = new Element("RESOURCE"));
  Element classElement  = new Element("CLASS");
  classElement.setText(resourceClass.getName());
  element.addContent(classElement);
  
  return doc;
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:14,代码来源:Plugin.java

示例2: fromXSchema

import org.jdom.JDOMException; //导入依赖的package包/类
/** Creates an AnnotationSchema object from an XSchema file
  * @param anXSchemaURL the URL where to find the XSchema file
  */
public void fromXSchema(URL anXSchemaURL)
            throws ResourceInstantiationException {
  org.jdom.Document jDom = null;
  SAXBuilder saxBuilder = new SAXBuilder(false);
  try {
  try{
    jDom = saxBuilder.build(anXSchemaURL);
  }catch(JDOMException je){
    throw new ResourceInstantiationException(je);
  }
  } catch (java.io.IOException ex) {
    throw new ResourceInstantiationException(ex);
  }
  workWithJDom(jDom);
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:19,代码来源:AnnotationSchema.java

示例3: processFullCreoleXmlTree

import org.jdom.JDOMException; //导入依赖的package包/类
private void processFullCreoleXmlTree(Plugin plugin,
    Document jdomDoc, CreoleAnnotationHandler annotationHandler)
    throws GateException, IOException, JDOMException {
  // now we can process any annotations on the new classes
  // and augment the XML definition
  annotationHandler.processAnnotations(jdomDoc);

  // debugging
  if(DEBUG) {
    XMLOutputter xmlOut = new XMLOutputter(Format.getPrettyFormat());
    xmlOut.output(jdomDoc, System.out);
  }

  // finally, parse the augmented definition with the normal parser
  DefaultHandler handler =
      new CreoleXmlHandler(this, plugin);
  SAXOutputter outputter =
      new SAXOutputter(handler, handler, handler, handler);
  outputter.output(jdomDoc);
  if(DEBUG) {
    Out.prln("done parsing " + plugin);
  }
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:24,代码来源:CreoleRegisterImpl.java

示例4: getCreoleXML

import org.jdom.JDOMException; //导入依赖的package包/类
@Override
public Document getCreoleXML() throws Exception, JDOMException {
  Document doc = new Document();
  Element element = null;
  doc.addContent(element = new Element("CREOLE-DIRECTORY"));

  element.addContent(element = new Element("CREOLE"));
  element.addContent(element = new Element("RESOURCE"));
  Element classElement = new Element("CLASS");
  classElement.setText(TestResource.class.getName());
  element.addContent(classElement);
  return doc;
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:14,代码来源:TestResourceReference.java

示例5: test_WebookConfig

import org.jdom.JDOMException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void test_WebookConfig() throws JDOMException, IOException{
	SAXBuilder builder = new SAXBuilder();
	List<MsTeamsNotificationConfig> configs = new ArrayList<MsTeamsNotificationConfig>();
	builder.setIgnoringElementContentWhitespace(true);
		Document doc = builder.build("src/test/resources/testdoc2.xml");
		Element root = doc.getRootElement();
		if(root.getChild("msteamsNotifications") != null){
			Element child = root.getChild("msteamsNotifications");
			if ((child.getAttribute("enabled") != null) && (child.getAttribute("enabled").equals("true"))){
				List<Element> namedChildren = child.getChildren("msteamsNotification");
				for(Iterator<Element> i = namedChildren.iterator(); i.hasNext();)
	            {
					Element e = i.next();
					MsTeamsNotificationConfig whConfig = new MsTeamsNotificationConfig(e);
					configs.add(whConfig);
	            }
			}
		}

	
	for (MsTeamsNotificationConfig c : configs){
		MsTeamsNotification wh = new MsTeamsNotificationImpl();
		wh.setEnabled(c.getEnabled());
		//msteamsNotification.addParams(c.getParams());
		System.out.println(wh.isEnabled().toString());

	}
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:31,代码来源:MsTeamsNotificationSettingsTest.java

示例6: test_ReadXml

import org.jdom.JDOMException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void test_ReadXml() throws JDOMException, IOException {
	SAXBuilder builder = new SAXBuilder();
	//builder.setValidation(true);
	builder.setIgnoringElementContentWhitespace(true);
	
		Document doc = builder.build("src/test/resources/testdoc1.xml");
		Element root = doc.getRootElement();
		System.out.println(root.toString());
		if(root.getChild("msteamsNotifications") != null){
			Element child = root.getChild("msteamsNotifications");
			if ((child.getAttribute("enabled") != null) && (child.getAttribute("enabled").equals("true"))){
				List<Element> namedChildren = child.getChildren("msteamsNotification");
				for(Iterator<Element> i = namedChildren.iterator(); i.hasNext();)
	            {
					Element e = i.next();
					System.out.println(e.toString() + e.getAttributeValue("url"));
					//assertTrue(e.getAttributeValue("url").equals("http://something"));
					if(e.getChild("parameters") != null){
						Element eParams = e.getChild("parameters");
						List<Element> paramsList = eParams.getChildren("param");
						for(Iterator<Element> j = paramsList.iterator(); j.hasNext();)
						{
							Element eParam = j.next();
							System.out.println(eParam.toString() + eParam.getAttributeValue("name"));
							System.out.println(eParam.toString() + eParam.getAttributeValue("value"));
						}
					}
	            }
			}
		}

}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:35,代码来源:MsTeamsNotificationSettingsTest.java

示例7: createModule

import org.jdom.JDOMException; //导入依赖的package包/类
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel)
  throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
  Module baseModule = super.createModule(moduleModel);
  String languageName = myCourse.getLanguageID();
  Language language = Language.findLanguageByID(languageName);
  if (language != null) {
    EduPluginConfigurator configurator = EduPluginConfigurator.INSTANCE.forLanguage(language);
    if (configurator != null) {
      Project project = baseModule.getProject();
      myGenerator.setSelectedCourse(myCourse);
      myGenerator.generateProject(project, project.getBaseDir());
      Course course = StudyTaskManager.getInstance(project).getCourse();
      if (course == null) {
        LOG.info("failed to generate course");
        return baseModule;
      }
      configurator.createCourseModuleContent(moduleModel, project, course, getModuleFileDirectory());
    }
  }
  return baseModule;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:24,代码来源:EduRemoteCourseModuleBuilder.java

示例8: createCourseFromCourseInfo

import org.jdom.JDOMException; //导入依赖的package包/类
public static void createCourseFromCourseInfo(@NotNull ModifiableModuleModel moduleModel,
                                       @NotNull Project project,
                                       @NotNull StudyProjectGenerator generator,
                                       @NotNull Course course,
                                       @Nullable String moduleDir) throws JDOMException, ModuleWithNameAlreadyExists, ConfigurationException, IOException {
  generator.setSelectedCourse(course);
  generator.generateProject(project, project.getBaseDir());
  updateAdaptiveCourseTaskFileNames(project, course);

  course = StudyTaskManager.getInstance(project).getCourse();
  if (course == null) {
    LOG.info("failed to generate course");
    return;
  }
  createCourseModuleContent(moduleModel, project, course, moduleDir);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:17,代码来源:EduModuleBuilderUtils.java

示例9: createModule

import org.jdom.JDOMException; //导入依赖的package包/类
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel) throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
  Module module = super.createModule(moduleModel);
  Course course = myTask.getLesson().getCourse();
  String directory = getModuleFileDirectory();
  if (directory == null) {
    return module;
  }
  VirtualFile moduleDir = VfsUtil.findFileByIoFile(new File(directory), true);
  if (moduleDir == null) {
    return module;
  }
  VirtualFile src = moduleDir.findChild(EduNames.SRC);
  if (src == null) {
    return module;
  }
  createTask(module.getProject(), course, src);
  ModuleRootModificationUtil.addDependency(module, myUtilModule);
  EduIntellijUtils.addJUnit(module);
  return module;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:23,代码来源:EduTaskModuleBuilder.java

示例10: createModule

import org.jdom.JDOMException; //导入依赖的package包/类
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel)
  throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
  Module baseModule = super.createModule(moduleModel);
  if (mySelectedCourse != null) {
    String languageName = mySelectedCourse.getLanguageID();
    Language language = Language.findLanguageByID(languageName);
    if (language != null) {
      EduPluginConfigurator configurator = EduPluginConfigurator.INSTANCE.forLanguage(language);
      if (configurator != null) {
        myGenerator.setSelectedCourse(mySelectedCourse);
        Project project = baseModule.getProject();
        myGenerator.generateProject(project, project.getBaseDir());
        Course course = StudyTaskManager.getInstance(project).getCourse();
        if (course == null) {
          LOG.info("failed to generate course");
          return baseModule;
        }
        configurator.createCourseModuleContent(moduleModel, project, course, getModuleFileDirectory());
      }
    }
  }
  return baseModule;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:26,代码来源:EduCustomCourseModuleBuilder.java

示例11: readComponent

import org.jdom.JDOMException; //导入依赖的package包/类
@Nullable
private static Element readComponent(@NotNull SAXBuilder parser, @NotNull String projectPath) {
  Element component = null;
  try {
    String studyProjectXML = projectPath + STUDY_PROJECT_XML_PATH;
    Document xmlDoc = parser.build(new File(studyProjectXML));
    Element root = xmlDoc.getRootElement();
    component = root.getChild("component");
  }
  catch (JDOMException | IOException ignored) {
  }

  return component;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:15,代码来源:EduBuiltInServerUtils.java

示例12: doTest

import org.jdom.JDOMException; //导入依赖的package包/类
private void doTest(int version) throws IOException, JDOMException, StudySerializationUtils.StudyUnrecognizedFormatException {
  final String name = PlatformTestUtil.getTestName(this.name.getMethodName(), true);
  final Path before = getTestDataPath().resolve(name + ".xml");
  final Path after = getTestDataPath().resolve(name + ".after.xml");
  Element element = JdomKt.loadElement(before);
  Element converted = element;
  switch (version) {
    case 1:
      converted = StudySerializationUtils.Xml.convertToSecondVersion(element);
      break;
    case 3:
      converted = StudySerializationUtils.Xml.convertToForthVersion(element);
      break;
    case 4:
      converted = StudySerializationUtils.Xml.convertToFifthVersion(element);
      break;
  }
  assertTrue(JDOMUtil.areElementsEqual(converted, JdomKt.loadElement(after)));
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:20,代码来源:StudyMigrationTest.java

示例13: createModule

import org.jdom.JDOMException; //导入依赖的package包/类
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel) throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
  Module baseModule = super.createModule(moduleModel);
  Project project = baseModule.getProject();
  EduProjectGenerator generator = new EduProjectGenerator();
  if (myCourse == null) {
    File courseRoot = StudyUtils.getBundledCourseRoot(DEFAULT_COURSE_NAME, EduKotlinKoansModuleBuilder.class);
    final Course course = generator.addLocalCourse(FileUtil.join(courseRoot.getPath(), DEFAULT_COURSE_NAME));
    if (course == null) {
      LOG.info("Failed to find course " + DEFAULT_COURSE_NAME);
      return baseModule;
    }
  }
  myCourse.setLanguage("kotlin");
  EduModuleBuilderUtils.createCourseFromCourseInfo(moduleModel, project, generator, myCourse, getModuleFileDirectory());
  return baseModule;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:19,代码来源:EduKotlinKoansModuleBuilder.java

示例14: findFirstVariable

import org.jdom.JDOMException; //导入依赖的package包/类
private String findFirstVariable(Category category, LASConfig lasConfig, HttpServletRequest request) throws JDOMException, LASException, UnsupportedEncodingException, HttpException, IOException {
	String dsid = null;		
	if ( category.hasVariableChildrenAttribute() ) {
		if ( category.getDataset() != null && category.getDataset().getID() != null ) {
			return category.getDataset().getID();
		}
		return category.getChildren_DatasetID();
	} else {
		ArrayList<Category> cats = getCategories(category.getID(), lasConfig, request, true);
		for (Iterator catIt = cats.iterator(); catIt.hasNext();) {
			Category cat = (Category) catIt.next();
			dsid = findFirstVariable(cat, lasConfig, request);
		}
	}
	return dsid;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:17,代码来源:Confluence.java

示例15: makeRegionIndex

import org.jdom.JDOMException; //导入依赖的package包/类
public String makeRegionIndex(String backendRequestXML, String cacheFileName) throws IOException, JDOMException {
    LASBackendRequest lasBackendRequest = new LASBackendRequest();      
    JDOMUtils.XML2JDOM(backendRequestXML, lasBackendRequest);
    LASBackendResponse lasBackendResponse = new LASBackendResponse();
    
    String sample = JDOMUtils.getResourcePath(this, "resources/java/xml/region_index.xml");
    String output = lasBackendRequest.getResultAsFile("index");
    copyBytes(sample, output);
    // Create the map scale XML file if requested.
    String index_filename = lasBackendRequest.getResultAsFileByType("index");
    if ( index_filename != null && !index_filename.equals("") ) {
        File index = new File(index_filename);
        LASRegionIndex lasRegionIndex = new LASRegionIndex(index);
        lasRegionIndex.write(index);
    }
            
    lasBackendResponse.addResponseFromRequest(lasBackendRequest);
    return lasBackendResponse.toString();
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:20,代码来源:JavaBackendService.java


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