本文整理汇总了C#中org.endTag方法的典型用法代码示例。如果您正苦于以下问题:C# org.endTag方法的具体用法?C# org.endTag怎么用?C# org.endTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org
的用法示例。
在下文中一共展示了org.endTag方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: writeValueXml
/// <summary>Flatten an object's value into an XmlSerializer.</summary>
/// <remarks>
/// Flatten an object's value into an XmlSerializer. The value can later
/// be read back with readThisValueXml().
/// Currently supported value types are: null, String, Integer, Long,
/// Float, Double Boolean, Map, List.
/// </remarks>
/// <param name="v">The object to be flattened.</param>
/// <param name="name">
/// Name attribute to include with this value's tag, or null
/// for none.
/// </param>
/// <param name="out">XmlSerializer to write the object into.</param>
/// <seealso cref="writeMapXml(java.util.Map{K, V}, java.io.OutputStream)">writeMapXml(java.util.Map<K, V>, java.io.OutputStream)
/// </seealso>
/// <seealso cref="writeListXml(java.util.List{E}, java.io.OutputStream)">writeListXml(java.util.List<E>, java.io.OutputStream)
/// </seealso>
/// <seealso cref="readValueXml(org.xmlpull.v1.XmlPullParser, string[])">readValueXml(org.xmlpull.v1.XmlPullParser, string[])
/// </seealso>
/// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception>
/// <exception cref="System.IO.IOException"></exception>
public static void writeValueXml(object v, string name, org.xmlpull.v1.XmlSerializer
@out)
{
string typeStr;
if (v == null)
{
@out.startTag(null, "null");
if (name != null)
{
@out.attribute(null, "name", name);
}
@out.endTag(null, "null");
return;
}
else
{
if (v is string)
{
@out.startTag(null, "string");
if (name != null)
{
@out.attribute(null, "name", name);
}
@out.text(v.ToString());
@out.endTag(null, "string");
return;
}
else
{
if (v is int)
{
typeStr = "int";
}
else
{
if (v is long)
{
typeStr = "long";
}
else
{
if (v is float)
{
typeStr = "float";
}
else
{
if (v is double)
{
typeStr = "double";
}
else
{
if (v is bool)
{
typeStr = "boolean";
}
else
{
if (v is byte[])
{
writeByteArrayXml((byte[])v, name, @out);
return;
}
else
{
if (v is int[])
{
writeIntArrayXml((int[])v, name, @out);
return;
}
else
{
if (v is java.util.Map<object, object>)
{
writeMapXml((java.util.Map<object, object>)v, name, @out);
return;
}
else
//.........这里部分代码省略.........
示例2: writeIntArrayXml
/// <summary>Flatten an int[] into an XmlSerializer.</summary>
/// <remarks>
/// Flatten an int[] into an XmlSerializer. The list can later be read back
/// with readThisIntArrayXml().
/// </remarks>
/// <param name="val">The int array to be flattened.</param>
/// <param name="name">
/// Name attribute to include with this array's tag, or null for
/// none.
/// </param>
/// <param name="out">XmlSerializer to write the array into.</param>
/// <seealso cref="writeMapXml(java.util.Map{K, V}, java.io.OutputStream)">writeMapXml(java.util.Map<K, V>, java.io.OutputStream)
/// </seealso>
/// <seealso cref="writeValueXml(object, string, org.xmlpull.v1.XmlSerializer)">writeValueXml(object, string, org.xmlpull.v1.XmlSerializer)
/// </seealso>
/// <seealso cref="readThisIntArrayXml(org.xmlpull.v1.XmlPullParser, string, string[])
/// ">readThisIntArrayXml(org.xmlpull.v1.XmlPullParser, string, string[])</seealso>
/// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception>
/// <exception cref="System.IO.IOException"></exception>
public static void writeIntArrayXml(int[] val, string name, org.xmlpull.v1.XmlSerializer
@out)
{
if (val == null)
{
@out.startTag(null, "null");
@out.endTag(null, "null");
return;
}
@out.startTag(null, "int-array");
if (name != null)
{
@out.attribute(null, "name", name);
}
int N = val.Length;
@out.attribute(null, "num", System.Convert.ToString(N));
{
for (int i = 0; i < N; i++)
{
@out.startTag(null, "item");
@out.attribute(null, "value", System.Convert.ToString(val[i]));
@out.endTag(null, "item");
}
}
@out.endTag(null, "int-array");
}
示例3: writeSetXml
/// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception>
/// <exception cref="System.IO.IOException"></exception>
public static void writeSetXml(java.util.Set<object> val, string name, org.xmlpull.v1.XmlSerializer
@out)
{
if (val == null)
{
@out.startTag(null, "null");
@out.endTag(null, "null");
return;
}
@out.startTag(null, "set");
if (name != null)
{
@out.attribute(null, "name", name);
}
foreach (object v in Sharpen.IterableProxy.Create(val))
{
writeValueXml(v, null, @out);
}
@out.endTag(null, "set");
}
示例4: writeByteArrayXml
/// <summary>Flatten a byte[] into an XmlSerializer.</summary>
/// <remarks>
/// Flatten a byte[] into an XmlSerializer. The list can later be read back
/// with readThisByteArrayXml().
/// </remarks>
/// <param name="val">The byte array to be flattened.</param>
/// <param name="name">
/// Name attribute to include with this array's tag, or null for
/// none.
/// </param>
/// <param name="out">XmlSerializer to write the array into.</param>
/// <seealso cref="writeMapXml(java.util.Map{K, V}, java.io.OutputStream)">writeMapXml(java.util.Map<K, V>, java.io.OutputStream)
/// </seealso>
/// <seealso cref="writeValueXml(object, string, org.xmlpull.v1.XmlSerializer)">writeValueXml(object, string, org.xmlpull.v1.XmlSerializer)
/// </seealso>
/// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception>
/// <exception cref="System.IO.IOException"></exception>
public static void writeByteArrayXml(byte[] val, string name, org.xmlpull.v1.XmlSerializer
@out)
{
if (val == null)
{
@out.startTag(null, "null");
@out.endTag(null, "null");
return;
}
@out.startTag(null, "byte-array");
if (name != null)
{
@out.attribute(null, "name", name);
}
int N = val.Length;
@out.attribute(null, "num", System.Convert.ToString(N));
java.lang.StringBuilder sb = new java.lang.StringBuilder(val.Length * 2);
{
for (int i = 0; i < N; i++)
{
int b = val[i];
int h = b >> 4;
sb.append(h >= 10 ? ('a' + h - 10) : ('0' + h));
h = b & unchecked((int)(0xff));
sb.append(h >= 10 ? ('a' + h - 10) : ('0' + h));
}
}
@out.text(sb.ToString());
@out.endTag(null, "byte-array");
}
示例5: writeListXml
/// <summary>Flatten a List into an XmlSerializer.</summary>
/// <remarks>
/// Flatten a List into an XmlSerializer. The list can later be read back
/// with readThisListXml().
/// </remarks>
/// <param name="val">The list to be flattened.</param>
/// <param name="name">
/// Name attribute to include with this list's tag, or null for
/// none.
/// </param>
/// <param name="out">XmlSerializer to write the list into.</param>
/// <seealso cref="writeListXml(java.util.List{E}, java.io.OutputStream)">writeListXml(java.util.List<E>, java.io.OutputStream)
/// </seealso>
/// <seealso cref="writeMapXml(java.util.Map{K, V}, java.io.OutputStream)">writeMapXml(java.util.Map<K, V>, java.io.OutputStream)
/// </seealso>
/// <seealso cref="writeValueXml(object, string, org.xmlpull.v1.XmlSerializer)">writeValueXml(object, string, org.xmlpull.v1.XmlSerializer)
/// </seealso>
/// <seealso cref="readListXml(java.io.InputStream)">readListXml(java.io.InputStream)
/// </seealso>
/// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception>
/// <exception cref="System.IO.IOException"></exception>
public static void writeListXml(java.util.List<object> val, string name, org.xmlpull.v1.XmlSerializer
@out)
{
if (val == null)
{
@out.startTag(null, "null");
@out.endTag(null, "null");
return;
}
@out.startTag(null, "list");
if (name != null)
{
@out.attribute(null, "name", name);
}
int N = val.size();
int i = 0;
while (i < N)
{
writeValueXml(val.get(i), null, @out);
i++;
}
@out.endTag(null, "list");
}