Java 类com.intellij.util.xmlb.XmlSerializationException 实例源码

项目:mule-intellij-plugins    文件:MuleSdkManagerImpl.java   
@Nullable
@Override
public Element getState()
{
    Element element = new Element("mule-sdks");
    try
    {
        for (MuleSdk sdk : sdks)
        {
            final Element sdkElement = new Element("mule-sdk");
            XmlSerializer.serializeInto(sdk, sdkElement, new SkipDefaultValuesSerializationFilters());
            element.addContent(sdkElement);
        }
    }
    catch (XmlSerializationException e)
    {
        LOG.error(e);
    }
    return element;
}
项目:mule-intellij-plugins    文件:MuleSdkManagerImpl.java   
@Override
public void loadState(Element state)
{
    final List<Element> children = state.getChildren();
    for (Element child : children)
    {
        try
        {
            final MuleSdk deserialize = XmlSerializer.deserialize(child, MuleSdk.class);
            if (deserialize != null && deserialize.getMuleHome() != null)
            {
                sdks.add(deserialize);
            }
        }
        catch (XmlSerializationException e)
        {
            LOG.error(e);
        }
    }
}
项目:intellij-ce-playground    文件:InspectionProfileEntry.java   
/**
 * Read in settings from XML config.
 * Default implementation uses XmlSerializer so you may use public fields (like <code>int TOOL_OPTION</code>)
 * and bean-style getters/setters (like <code>int getToolOption(), void setToolOption(int)</code>) to store your options.
 *
 * @param node to read settings from.
 * @throws InvalidDataException if the loaded data was not valid.
 */
@SuppressWarnings("deprecation")
public void readSettings(@NotNull Element node) throws InvalidDataException {
  if (useNewSerializer()) {
    try {
      XmlSerializer.deserializeInto(this, node);
    }
    catch (XmlSerializationException e) {
      throw new InvalidDataException(e);
    }
  }
  else {
    //noinspection UnnecessaryFullyQualifiedName
    com.intellij.openapi.util.DefaultJDOMExternalizer.readExternal(this, node);
  }
}
项目:intellij-ce-playground    文件:LibrariesDownloadAssistant.java   
@Nullable
private static Artifacts deserialize(@Nullable URL url) {
  if (url == null) return null;

  Artifacts allArtifacts = null;
  try {
    allArtifacts = XmlSerializer.deserialize(url, Artifacts.class);
  }
  catch (XmlSerializationException e) {
    final Throwable cause = e.getCause();
    if (!(cause instanceof IOException)) {
      LOG.error(e);
    }
  }
  return allArtifacts;
}
项目:intellij-ce-playground    文件:TaskManagerImpl.java   
public static ArrayList<TaskRepository> loadRepositories(Element element) {
  ArrayList<TaskRepository> repositories = new ArrayList<TaskRepository>();
  for (TaskRepositoryType repositoryType : TaskRepositoryType.getRepositoryTypes()) {
    for (Object o : element.getChildren()) {
      if (((Element)o).getName().equals(repositoryType.getName())) {
        try {
          @SuppressWarnings({"unchecked"})
          TaskRepository repository = (TaskRepository)XmlSerializer.deserialize((Element)o, repositoryType.getRepositoryClass());
          if (repository != null) {
            repository.setRepositoryType(repositoryType);
            repositories.add(repository);
          }
        }
        catch (XmlSerializationException e) {
          LOG.error(e.getMessage(), e);
        }
      }
    }
  }
  return repositories;
}
项目:tools-idea    文件:InspectionProfileEntry.java   
/**
 * Read in settings from XML config.
 * Default implementation uses XmlSerializer so you may use public fields (like <code>int TOOL_OPTION</code>)
 * and bean-style getters/setters (like <code>int getToolOption(), void setToolOption(int)</code>) to store your options.
 *
 * @param node to read settings from.
 * @throws InvalidDataException if the loaded data was not valid.
 */
@SuppressWarnings("deprecation")
public void readSettings(@NotNull Element node) throws InvalidDataException {
  if (useNewSerializer()) {
    try {
      XmlSerializer.deserializeInto(this, node);
    }
    catch (XmlSerializationException e) {
      throw new InvalidDataException(e);
    }
  }
  else {
    //noinspection UnnecessaryFullyQualifiedName
    com.intellij.openapi.util.DefaultJDOMExternalizer.readExternal(this, node);
  }
}
项目:tools-idea    文件:IdeSettingsStatisticsService.java   
@Nullable
private static IdeSettingsDescriptors deserialize(@Nullable URL url) {
  if (url == null) return null;

  IdeSettingsDescriptors ideSettingsDescriptor = null;
  try {
    ideSettingsDescriptor = XmlSerializer.deserialize(url, IdeSettingsDescriptors.class);
  }
  catch (XmlSerializationException e) {
    final Throwable cause = e.getCause();
    if (!(cause instanceof IOException)) {
      LOG.error(e);
    }
  }
  return ideSettingsDescriptor;
}
项目:tools-idea    文件:LibrariesDownloadAssistant.java   
@Nullable
private static Artifacts deserialize(@Nullable URL url) {
  if (url == null) return null;

  Artifacts allArtifacts = null;
  try {
    allArtifacts = XmlSerializer.deserialize(url, Artifacts.class);
  }
  catch (XmlSerializationException e) {
    final Throwable cause = e.getCause();
    if (!(cause instanceof IOException)) {
      LOG.error(e);
    }
  }
  return allArtifacts;
}
项目:tools-idea    文件:TaskManagerImpl.java   
public static ArrayList<TaskRepository> loadRepositories(Element element) {
  ArrayList<TaskRepository> repositories = new ArrayList<TaskRepository>();
  for (TaskRepositoryType repositoryType : ourRepositoryTypes) {
    for (Object o : element.getChildren()) {
      if (((Element)o).getName().equals(repositoryType.getName())) {
        try {
          @SuppressWarnings({"unchecked"})
          TaskRepository repository = (TaskRepository)XmlSerializer.deserialize((Element)o, repositoryType.getRepositoryClass());
          if (repository != null) {
            repository.setRepositoryType(repositoryType);
            repositories.add(repository);
          }
        }
        catch (XmlSerializationException e) {
          // ignore
        }
      }
    }
  }
  return repositories;
}
项目:consulo    文件:InspectionProfileEntry.java   
/**
 * Read in settings from XML config.
 * Default implementation uses XmlSerializer so you may use public fields (like <code>int TOOL_OPTION</code>)
 * and bean-style getters/setters (like <code>int getToolOption(), void setToolOption(int)</code>) to store your options.
 *
 * @param node to read settings from.
 * @throws InvalidDataException if the loaded data was not valid.
 */
@SuppressWarnings("deprecation")
public void readSettings(@Nonnull Element node) throws InvalidDataException {
  if (useNewSerializer()) {
    try {
      XmlSerializer.deserializeInto(this, node);
    }
    catch (XmlSerializationException e) {
      throw new InvalidDataException(e);
    }
  }
  else {
    //noinspection UnnecessaryFullyQualifiedName
    com.intellij.openapi.util.DefaultJDOMExternalizer.readExternal(this, node);
  }
}
项目:educational-plugin    文件:EduBuiltInServerUtils.java   
private static int getCourseId(@NotNull StudyTaskManager taskManager, @NotNull Element component) {
  try {
    taskManager.loadState(component);
    Course course = taskManager.getCourse();

    if (course instanceof RemoteCourse) {
      return ((RemoteCourse)course).getId();
    }
  }
  catch (IllegalStateException | XmlSerializationException ignored) {
  }
  return 0;
}
项目:intellij-ce-playground    文件:LibraryJarStatisticsService.java   
@Nullable
private static LibraryJarDescriptors deserialize(@Nullable URL url) {
  if (url == null) return null;

  LibraryJarDescriptors libraryJarDescriptors = null;
  try {
    libraryJarDescriptors = XmlSerializer.deserialize(url, LibraryJarDescriptors.class);
  }
  catch (XmlSerializationException e) {
    //
  }
  return libraryJarDescriptors;
}
项目:intellij-ce-playground    文件:CodeInsightSettings.java   
@Override
public void loadState(final Element state) {
  try {
    XmlSerializer.deserializeInto(this, state);
  }
  catch (XmlSerializationException e) {
    LOG.info(e);
  }
}
项目:intellij-ce-playground    文件:CodeInsightSettings.java   
public void writeExternal(final Element element) {
  try {
    XmlSerializer.serializeInto(this, element, new SkipDefaultValuesSerializationFilters());
  }
  catch (XmlSerializationException e) {
    LOG.info(e);
  }
}
项目:clever-intellij-plugin    文件:CleverCloudProjectComponent.java   
@Override
public void projectOpened() {
  ProjectSettings projectSettings = ServiceManager.getService(myProject, ProjectSettings.class);
  try {
    if (projectSettings.applications.isEmpty()) {
      detectCleverApp();
    }
    else {
      CcLogsToolWindow ccLogsToolWindow = new CcLogsToolWindow(myProject);
    }
  }
  catch (XmlSerializationException e) {
    e.printStackTrace();
  }
}
项目:tools-idea    文件:CodeInsightSettings.java   
@Override
public void loadState(final Element state) {
  try {
    XmlSerializer.deserializeInto(this, state);
  }
  catch (XmlSerializationException e) {
    LOG.info(e);
  }
}
项目:tools-idea    文件:CodeInsightSettings.java   
public void writeExternal(final Element element) {
  try {
    XmlSerializer.serializeInto(this, element, new SkipDefaultValuesSerializationFilters());
  }
  catch (XmlSerializationException e) {
    LOG.info(e);
  }
}
项目:consulo-tasks    文件:TaskManagerImpl.java   
public static ArrayList<TaskRepository> loadRepositories(Element element)
{
    ArrayList<TaskRepository> repositories = new ArrayList<>();
    for(TaskRepositoryType repositoryType : TaskRepositoryType.getRepositoryTypes())
    {
        for(Object o : element.getChildren())
        {
            if(((Element) o).getName().equals(repositoryType.getName()))
            {
                try
                {
                    @SuppressWarnings({"unchecked"}) TaskRepository repository = (TaskRepository) XmlSerializer.deserialize((Element) o, repositoryType.getRepositoryClass());
                    if(repository != null)
                    {
                        repository.setRepositoryType(repositoryType);
                        repositories.add(repository);
                    }
                }
                catch(XmlSerializationException e)
                {
                    LOG.error(e.getMessage(), e);
                }
            }
        }
    }
    return repositories;
}
项目:consulo    文件:CodeInsightSettings.java   
@Override
public void loadState(final Element state) {
  try {
    XmlSerializer.deserializeInto(this, state);
  }
  catch (XmlSerializationException e) {
    LOG.info(e);
  }
}
项目:consulo    文件:CodeInsightSettings.java   
public void writeExternal(final Element element) {
  try {
    XmlSerializer.serializeInto(this, element, new SkipDefaultValuesSerializationFilters());
  }
  catch (XmlSerializationException e) {
    LOG.info(e);
  }
}
项目:consulo-java    文件:JavaSmartKeysSettings.java   
@Override
public void loadState(final Element state)
{
    try
    {
        XmlSerializer.deserializeInto(this, state);
    }
    catch(XmlSerializationException e)
    {
        JavaSmartKeysSettings.LOGGER.info(e);
    }
}
项目:consulo-java    文件:JavaSmartKeysSettings.java   
public void writeExternal(final Element element)
{
    try
    {
        XmlSerializer.serializeInto(this, element, new SkipDefaultValuesSerializationFilters());
    }
    catch(XmlSerializationException e)
    {
        JavaSmartKeysSettings.LOGGER.info(e);
    }
}