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


Java NanoXmlUtil.parse方法代码示例

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


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

示例1: parse

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
public static MultiMap<SchemaTypeInfo, SchemaTypeInfo> parse(final Reader reader) {
  try {
    final XsdComplexTypeInfoBuilder builder = new XsdComplexTypeInfoBuilder();
    final NameSpaceHelper helper = new NameSpaceHelper();
    builder.setNameSpaceHelper(helper);
    NanoXmlUtil.parse(reader, builder, helper);
    final MultiMap<SchemaTypeInfo,SchemaTypeInfo> map = builder.getMap();
    return map;
  } finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
    catch (IOException e) {
      // can never happen
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:XsdComplexTypeInfoBuilder.java

示例2: computeNamespace

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
public static XsdNamespaceBuilder computeNamespace(final Reader reader) {
  try {
    final XsdNamespaceBuilder builder = new XsdNamespaceBuilder();
    NanoXmlUtil.parse(reader, builder);
    HashSet<String> tags = new HashSet<String>(builder.getTags());
    tags.removeAll(builder.myReferencedTags);
    builder.getRootTags().addAll(tags);
    return builder;
  }
  finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
    catch (IOException e) {
      // can never happen
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:XsdNamespaceBuilder.java

示例3: computeTagNames

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
@NotNull
public static Collection<String> computeTagNames(final Reader reader) {
  try {
    final XsdTagNameBuilder builder = new XsdTagNameBuilder();
    NanoXmlUtil.parse(reader, builder);
    return builder.myTagNames;
  }
  finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
    catch (IOException e) {
      // can never happen
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:XsdTagNameBuilder.java

示例4: isSimilarFile

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
private static boolean isSimilarFile(FileContent inputData) {
  if (CharArrayUtil.indexOf(inputData.getContentAsText(), "<" + RESOURCES_ROOT_TAG, 0) < 0) {
    return false;
  }
  final boolean[] ourRootTag = {false};

  NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()), new NanoXmlUtil.IXMLBuilderAdapter() {
    @Override
    public void startElement(String name, String nsPrefix, String nsURI, String systemID, int lineNr)
      throws Exception {
      ourRootTag[0] = RESOURCES_ROOT_TAG.equals(name) && nsPrefix == null;
      stop();
    }
  });
  return ourRootTag[0];
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AndroidValueResourcesIndex.java

示例5: parsePublicResCache

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
@Nullable
private void parsePublicResCache() {
  final String resDirPath = myTarget.getPath(IAndroidTarget.RESOURCES);
  final String publicXmlPath = resDirPath + '/' + SdkConstants.FD_RES_VALUES + "/public.xml";
  final VirtualFile publicXml = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(publicXmlPath));

  if (publicXml != null) {
    try {
      final MyPublicResourceCacheBuilder builder = new MyPublicResourceCacheBuilder();
      NanoXmlUtil.parse(publicXml.getInputStream(), builder);

      synchronized (myPublicResourceCacheLock) {
        myPublicResourceCache = builder.getPublicResourceCache();
        myPublicResourceIdMap = builder.getIdMap();
      }
    }
    catch (IOException e) {
      LOG.error(e);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AndroidTargetData.java

示例6: getIds

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
@Nullable
protected Map<String, Set<String>> getIds(String content, final VirtualFile file, Project project) {
  if (!content.contains(JavaFXNamespaceProvider.JAVAFX_NAMESPACE)) {
    return null;
  }

  final Map<String, Set<String>> map = new HashMap<String, Set<String>>();
  final String path = file.getPath();
  final IXMLBuilder handler = createParseHandler(path, map);
  try {
    NanoXmlUtil.parse(new StringReader(content), handler);
  }
  catch (StopException ignore) {}
  final VirtualFile sourceRoot = ProjectRootManager.getInstance(project).getFileIndex().getSourceRootForFile(file);
  endDocument(path, sourceRoot, map, handler);
  return map;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FxmlDataIndexer.java

示例7: computeNamespace

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
public static XsdNamespaceBuilder computeNamespace(final Reader reader) {
  try {
    final XsdNamespaceBuilder builder = new XsdNamespaceBuilder();
    NanoXmlUtil.parse(reader, builder);
    return builder;
  }
  finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
    catch (IOException e) {
      // can never happen
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:XsdNamespaceBuilder.java

示例8: computeTagNames

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
@Nullable
public static Collection<String> computeTagNames(final Reader reader) {
  try {
    final XsdTagNameBuilder builder = new XsdTagNameBuilder();
    NanoXmlUtil.parse(reader, builder);
    return builder.myTagNames;
  }
  finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
    catch (IOException e) {
      // can never happen
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:XsdTagNameBuilder.java

示例9: computeNamespace

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
public static XsdNamespaceBuilder computeNamespace(final Reader reader)
{
	try
	{
		final XsdNamespaceBuilder builder = new XsdNamespaceBuilder();
		NanoXmlUtil.parse(reader, builder);
		HashSet<String> tags = new HashSet<String>(builder.getTags());
		tags.removeAll(builder.myReferencedTags);
		builder.getRootTags().addAll(tags);
		return builder;
	}
	finally
	{
		try
		{
			if(reader != null)
			{
				reader.close();
			}
		}
		catch(IOException e)
		{
			// can never happen
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:27,代码来源:XsdNamespaceBuilder.java

示例10: getIncludeInfos

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
@NotNull
@Override
public FileIncludeInfo[] getIncludeInfos(FileContent content) {
  final ArrayList<FileIncludeInfo> infos;

  if (content.getFileType() == XmlFileType.INSTANCE) {
    CharSequence inputDataContentAsText = content.getContentAsText();
    if (CharArrayUtil.indexOf(inputDataContentAsText, ApplicationLoader.RNG_NAMESPACE, 0) == -1) return FileIncludeInfo.EMPTY;
    infos = new ArrayList<FileIncludeInfo>();
    NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(content.getContentAsText()), new RngBuilderAdapter(infos));
  } else if (content.getFileType() == RncFileType.getInstance()) {
    infos = new ArrayList<FileIncludeInfo>();
    content.getPsiFile().acceptChildren(new RncElementVisitor() {
      @Override
      public void visitElement(RncElement element) {
        element.acceptChildren(this);
      }

      @Override
      public void visitInclude(RncInclude include) {
        final String path = include.getFileReference();
        if (path != null) {
          infos.add(new FileIncludeInfo(path));
        }
      }
    });
  } else {
    return FileIncludeInfo.EMPTY;
  }
  return infos.toArray(new FileIncludeInfo[infos.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:RelaxIncludeProvider.java

示例11: parse

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
@Nullable
private static MyIXMLBuilderAdapter parse(CharSequence text, boolean stopIfAccepted) {
  StdXMLReader reader = new StdXMLReader(CharArrayUtil.readerFromCharSequence(text)) {
    @Override
    public Reader openStream(String publicID, String systemID) throws IOException {
      if (!HTTP_JAVA_SUN_COM_DTD_PROPERTIES_DTD.equals(systemID)) throw new IOException();
      return new StringReader(" ");
    }
  };
  MyIXMLBuilderAdapter builder = new MyIXMLBuilderAdapter(stopIfAccepted);
  NanoXmlUtil.parse(reader, builder);
  return builder;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:XmlPropertiesIndex.java

示例12: parse

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
@Nullable
private static MyIXMLBuilderAdapter parse(CharSequence text, boolean stopIfAccepted) {
  StdXMLReader reader = new StdXMLReader(CharArrayUtil.readerFromCharSequence(text)) {
    @Override
    public Reader openStream(String publicID, String systemID) throws IOException {
      if (!"http://java.sun.com/dtd/properties.dtd".equals(systemID)) throw new IOException();
      return new StringReader(" ");
    }
  };
  MyIXMLBuilderAdapter builder = new MyIXMLBuilderAdapter(stopIfAccepted);
  NanoXmlUtil.parse(reader, builder);
  return builder;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:XmlPropertiesIndex.java

示例13: getIncludeInfos

import com.intellij.util.xml.NanoXmlUtil; //导入方法依赖的package包/类
@NotNull
@Override
public FileIncludeInfo[] getIncludeInfos(FileContent content) {
  final ArrayList<FileIncludeInfo> infos;

  if (content.getFileType() == XmlFileType.INSTANCE) {
    CharSequence inputDataContentAsText = content.getContentAsText();
    if (CharArrayUtil.indexOf(inputDataContentAsText, ApplicationLoader.RNG_NAMESPACE, 0) == -1) return FileIncludeInfo.EMPTY;
    infos = new ArrayList<>();
    NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(content.getContentAsText()), new RngBuilderAdapter(infos));
  } else if (content.getFileType() == RncFileType.getInstance()) {
    infos = new ArrayList<>();
    content.getPsiFile().acceptChildren(new RncElementVisitor() {
      @Override
      public void visitElement(RncElement element) {
        element.acceptChildren(this);
      }

      @Override
      public void visitInclude(RncInclude include) {
        final String path = include.getFileReference();
        if (path != null) {
          infos.add(new FileIncludeInfo(path));
        }
      }
    });
  } else {
    return FileIncludeInfo.EMPTY;
  }
  return infos.toArray(new FileIncludeInfo[infos.size()]);
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:32,代码来源:RelaxIncludeProvider.java


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