gpt4 book ai didi

com.google.gdata.util.common.xml.XmlWriter.setDefaultNamespace()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 12:12:40 25 4
gpt4 key购买 nike

本文整理了Java中com.google.gdata.util.common.xml.XmlWriter.setDefaultNamespace()方法的一些代码示例,展示了XmlWriter.setDefaultNamespace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlWriter.setDefaultNamespace()方法的具体详情如下:
包路径:com.google.gdata.util.common.xml.XmlWriter
类名称:XmlWriter
方法名:setDefaultNamespace

XmlWriter.setDefaultNamespace介绍

[英]Sets the default namespace. It takes effect on the next element.
[中]设置默认名称空间。它在下一个元素上生效。

代码示例

代码示例来源:origin: com.google.gdata/gdata-java-client

/**
 * Override generateAtom() method to change the default namespace to kml.
 */
@Override
public void generateAtom(XmlWriter w, ExtensionProfile extProfile)
  throws IOException {
 if (isKmlDefault) {
  w.setDefaultNamespace(DataConstants.KML_NAMESPACE);
 }
 super.generateAtom(w, extProfile);
}

代码示例来源:origin: com.google.gdata/gdata-java-client

/**
  * Override generateAtom() method to change the default namespace to kml.
  */
 @Override
 public void generateAtom(com.google.gdata.util.common.xml.XmlWriter w,
   com.google.gdata.data.ExtensionProfile extProfile)
   throws java.io.IOException {

  if (isKmlDefault) {
   w.setDefaultNamespace(DataConstants.KML_NAMESPACE);
  }
  super.generateAtom(w, extProfile);
 }
}

代码示例来源:origin: com.mulesoft.google/google-api-gdata

/**
  * Override generateAtom() method to change the default namespace to kml.
  */
 @Override
 public void generateAtom(com.google.gdata.util.common.xml.XmlWriter w,
   com.google.gdata.data.ExtensionProfile extProfile)
   throws java.io.IOException {

  if (isKmlDefault) {
   w.setDefaultNamespace(DataConstants.KML_NAMESPACE);
  }
  super.generateAtom(w, extProfile);
 }
}

代码示例来源:origin: com.mulesoft.google/google-api-gdata

/**
 * Override generateAtom() method to change the default namespace to kml.
 */
@Override
public void generateAtom(XmlWriter w, ExtensionProfile extProfile)
  throws IOException {
 if (isKmlDefault) {
  w.setDefaultNamespace(DataConstants.KML_NAMESPACE);
 }
 super.generateAtom(w, extProfile);
}

代码示例来源:origin: com.google.gdata/gdata-core-1.0

@Override
 public void generateXml(XmlWriter xw, OutputProperties outProps, IAtom source)
   throws IOException {

  xw.setDefaultNamespace(Namespaces.atomNs);
  ExtensionProfile extProfile = outProps.getExtensionProfile();
  if (source instanceof IFeed) {
   IFeed feed = (IFeed) source;
   if (feed instanceof BaseFeed) {
    ((BaseFeed<?, ?>) feed).generateAtom(xw, extProfile);
   } else {
    throw new IllegalArgumentException("Feed was not an instance of data.BaseFeed");
   }
  } else if (source instanceof IEntry) {
   IEntry entry = (IEntry) source;
   if (entry instanceof BaseEntry) {
    ((BaseEntry<?>) entry).generateAtom(xw, extProfile);
   } else {
    throw new IllegalArgumentException("Entry was not an instance of data.BaseEntry");
   }
  } else if (source != null) {
   // This case is to handle case that may return Atom content but might
   // also return no data (like DELETE)
   throw new IllegalStateException("Unexpected source type: " + source.getClass());
  }
 }
}

代码示例来源:origin: com.google.gdata/gdata-java-client

@Override
 public void generateXml(XmlWriter xw, OutputProperties outProps, IAtom source)
   throws IOException {

  xw.setDefaultNamespace(Namespaces.atomNs);
  ExtensionProfile extProfile = outProps.getExtensionProfile();
  if (source instanceof IFeed) {
   IFeed feed = (IFeed) source;
   if (feed instanceof BaseFeed) {
    ((BaseFeed<?, ?>) feed).generateAtom(xw, extProfile);
   } else {
    throw new IllegalArgumentException("Feed was not an instance of data.BaseFeed");
   }
  } else if (source instanceof IEntry) {
   IEntry entry = (IEntry) source;
   if (entry instanceof BaseEntry) {
    ((BaseEntry<?>) entry).generateAtom(xw, extProfile);
   } else {
    throw new IllegalArgumentException("Entry was not an instance of data.BaseEntry");
   }
  } else if (source != null) {
   // This case is to handle case that may return Atom content but might
   // also return no data (like DELETE)
   throw new IllegalStateException("Unexpected source type: " + source.getClass());
  }
 }
}

代码示例来源:origin: com.mulesoft.google/google-api-gdata

@Override
 public void generateXml(XmlWriter xw, OutputProperties outProps, IAtom source)
   throws IOException {

  xw.setDefaultNamespace(Namespaces.atomNs);
  ExtensionProfile extProfile = outProps.getExtensionProfile();
  if (source instanceof IFeed) {
   IFeed feed = (IFeed) source;
   if (feed instanceof BaseFeed) {
    ((BaseFeed<?, ?>) feed).generateAtom(xw, extProfile);
   } else {
    throw new IllegalArgumentException("Feed was not an instance of data.BaseFeed");
   }
  } else if (source instanceof IEntry) {
   IEntry entry = (IEntry) source;
   if (entry instanceof BaseEntry) {
    ((BaseEntry<?>) entry).generateAtom(xw, extProfile);
   } else {
    throw new IllegalArgumentException("Entry was not an instance of data.BaseEntry");
   }
  } else if (source != null) {
   // This case is to handle case that may return Atom content but might
   // also return no data (like DELETE)
   throw new IllegalStateException("Unexpected source type: " + source.getClass());
  }
 }
}

代码示例来源:origin: com.google.gdata/gdata-java-client

/**
 * Sets the root element for generation.  This is used to derive the default
 * metadata that should be used.
 */
private void setRootNamespace(ElementMetadata<?, ?> meta, Element e) {
 XmlNamespace rootNs = defaultNamespace;
 // If no default has been set, we use the namespace of the root element as
 // the default namespace.
 if (rootNs == USE_ROOT_ELEMENT_NAMESPACE) {
  if (meta != null) {
   rootNs = meta.getDefaultNamespace();
  } else {
   rootNs = e.getElementId().getNs();
  }
 }
 if (rootNs != null) {
  xw.setDefaultNamespace(rootNs);
 }
}

代码示例来源:origin: com.google.gdata/gdata-core-1.0

/**
 * Sets the root element for generation.  This is used to derive the default
 * metadata that should be used.
 */
private void setRootNamespace(ElementMetadata<?, ?> meta, Element e) {
 XmlNamespace rootNs = defaultNamespace;
 // If no default has been set, we use the namespace of the root element as
 // the default namespace.
 if (rootNs == USE_ROOT_ELEMENT_NAMESPACE) {
  if (meta != null) {
   rootNs = meta.getDefaultNamespace();
  } else {
   rootNs = e.getElementId().getNs();
  }
 }
 if (rootNs != null) {
  xw.setDefaultNamespace(rootNs);
 }
}

代码示例来源:origin: com.mulesoft.google/google-api-gdata

/**
 * Sets the root element for generation.  This is used to derive the default
 * metadata that should be used.
 */
private void setRootNamespace(ElementMetadata<?, ?> meta, Element e) {
 XmlNamespace rootNs = defaultNamespace;
 // If no default has been set, we use the namespace of the root element as
 // the default namespace.
 if (rootNs == USE_ROOT_ELEMENT_NAMESPACE) {
  if (meta != null) {
   rootNs = meta.getDefaultNamespace();
  } else {
   rootNs = e.getElementId().getNs();
  }
 }
 if (rootNs != null) {
  xw.setDefaultNamespace(rootNs);
 }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com