コード例 #1
0
ファイル: XMLScanner.java プロジェクト: grdryn/jbosstools-jst
  public LoadedDeclarations parse(XModelObject o, IPath source, IKbProject sp) {
    if (o == null) return null;

    if (o.getParent() instanceof FolderImpl) {
      IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(source);
      if (f != null && f.exists()) {
        try {
          ((FolderImpl) o.getParent()).updateChildFile(o, f.getLocation().toFile());
        } catch (XModelException e) {
          ModelPlugin.getPluginLog().logError(e);
        }
        if (o.getParent() == null) {
          boolean b = isLikelyComponentSource(f);
          if (!b) return null;
          o = EclipseResourceUtil.getObjectByResource(o.getModel(), f);
          if (o == null) return null;
        }
      }
    }

    LoadedDeclarations ds = new LoadedDeclarations();
    if (LibraryScanner.isTLDFile(o)) {
      parseTLD(o, source, ds);
    } else if (LibraryScanner.isFaceletTaglibFile(o)) {
      parseFaceletTaglib(o, source, ds);
    } else if (LibraryScanner.isFacesConfigFile(o)) {
      parseFacesConfig(o, source, ds);
    }
    return ds;
  }
コード例 #2
0
 public void run() {
   try {
     DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
     if (validate) f.setValidating(validate);
     d = f.newDocumentBuilder();
   } catch (ParserConfigurationException e) {
     ModelPlugin.getPluginLog().logError(e);
   }
 }
コード例 #3
0
 public static DocumentBuilder createDocumentBuilder(boolean validating) {
   /*
    * This Thread call is workaround that except empty thread Context ClassLoader
    */
   try {
     return new SafeDocumentBuilderFactory(validating).d;
   } catch (InterruptedException e) {
     ModelPlugin.getPluginLog().logError(e);
     return null;
   }
 }