本文整理汇总了Java中com.intellij.util.xmlb.XmlSerializationException类的典型用法代码示例。如果您正苦于以下问题:Java XmlSerializationException类的具体用法?Java XmlSerializationException怎么用?Java XmlSerializationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlSerializationException类属于com.intellij.util.xmlb包,在下文中一共展示了XmlSerializationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getState
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
@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;
}
示例2: loadState
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
@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);
}
}
}
示例3: readSettings
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
/**
* 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);
}
}
示例4: deserialize
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
@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;
}
示例5: loadRepositories
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
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;
}
示例6: deserialize
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
@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;
}
示例7: loadRepositories
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
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;
}
示例8: readSettings
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
/**
* 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);
}
}
示例9: getCourseId
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
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;
}
示例10: deserialize
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
@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;
}
示例11: loadState
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
@Override
public void loadState(final Element state) {
try {
XmlSerializer.deserializeInto(this, state);
}
catch (XmlSerializationException e) {
LOG.info(e);
}
}
示例12: writeExternal
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
public void writeExternal(final Element element) {
try {
XmlSerializer.serializeInto(this, element, new SkipDefaultValuesSerializationFilters());
}
catch (XmlSerializationException e) {
LOG.info(e);
}
}
示例13: projectOpened
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
@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();
}
}
示例14: loadRepositories
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
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;
}
示例15: loadState
import com.intellij.util.xmlb.XmlSerializationException; //导入依赖的package包/类
@Override
public void loadState(final Element state)
{
try
{
XmlSerializer.deserializeInto(this, state);
}
catch(XmlSerializationException e)
{
JavaSmartKeysSettings.LOGGER.info(e);
}
}