mirror of
https://github.com/etesync/android
synced 2025-07-05 06:12:36 +00:00
307 lines
11 KiB
HTML
307 lines
11 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!--NewPage-->
|
|
<HTML>
|
|
<HEAD>
|
|
<!-- Generated by javadoc (build 1.6.0_37) on Mon Feb 18 20:39:44 EST 2013 -->
|
|
<TITLE>
|
|
Path
|
|
</TITLE>
|
|
|
|
<META NAME="date" CONTENT="2013-02-18">
|
|
|
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
|
|
|
|
<SCRIPT type="text/javascript">
|
|
function windowTitle()
|
|
{
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="Path";
|
|
}
|
|
}
|
|
</SCRIPT>
|
|
<NOSCRIPT>
|
|
</NOSCRIPT>
|
|
|
|
</HEAD>
|
|
|
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
|
<HR>
|
|
|
|
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<A NAME="navbar_top"><!-- --></A>
|
|
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
<TR>
|
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
<A NAME="navbar_top_firstrow"><!-- --></A>
|
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
<TR ALIGN="center" VALIGN="top">
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
</EM>
|
|
</TD>
|
|
</TR>
|
|
|
|
<TR>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../org/simpleframework/xml/Order.html" title="annotation in org.simpleframework.xml"><B>PREV CLASS</B></A>
|
|
<A HREF="../../../org/simpleframework/xml/Root.html" title="annotation in org.simpleframework.xml"><B>NEXT CLASS</B></A></FONT></TD>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../index.html?org/simpleframework/xml/Path.html" target="_top"><B>FRAMES</B></A>
|
|
<A HREF="Path.html" target="_top"><B>NO FRAMES</B></A>
|
|
<SCRIPT type="text/javascript">
|
|
<!--
|
|
if(window==top) {
|
|
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
}
|
|
//-->
|
|
</SCRIPT>
|
|
<NOSCRIPT>
|
|
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
</NOSCRIPT>
|
|
|
|
|
|
</FONT></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
SUMMARY: <A HREF="#annotation_type_required_element_summary">REQUIRED</A> | OPTIONAL</FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD>
|
|
</TR>
|
|
</TABLE>
|
|
<A NAME="skip-navbar_top"></A>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
|
|
<HR>
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<H2>
|
|
<FONT SIZE="-1">
|
|
org.simpleframework.xml</FONT>
|
|
<BR>
|
|
Annotation Type Path</H2>
|
|
<HR>
|
|
<DL>
|
|
<DT><PRE><FONT SIZE="-1">@Retention(value=RUNTIME)
|
|
</FONT>public @interface <B>Path</B></DL>
|
|
</PRE>
|
|
|
|
<P>
|
|
The <code>Path</code> annotation is used to specify an XML path
|
|
where an XML element or attribute is located. The format must be
|
|
in XPath format. When an XML structure does not map exactly to
|
|
an object model this annotation can be used to navigate the XML
|
|
document in order to map attributes and elements to an associated
|
|
field or method. For example, take the annotation shown below.
|
|
<pre>
|
|
|
|
@Element
|
|
@Path("contact-info/phone")
|
|
private String number;
|
|
|
|
</pre>
|
|
For the above annotation the XPath expression locates the phone
|
|
number nested within several elements. Such a declaration can
|
|
be used when a flat object structure is not suitable. The above
|
|
annotations will result in the below XML elements.
|
|
<pre>
|
|
|
|
<contact-info>
|
|
<phone>
|
|
<number>1800123123</number>
|
|
</phone>
|
|
</contact-info>
|
|
|
|
</pre>
|
|
As can be seen from this XML snippet a single field has been
|
|
mapped with several elements. These XPath expressions can be used
|
|
with either elements or attributes to convert an otherwise flat
|
|
object to XML structure in to something more complex. This is
|
|
useful when mapping objects to foreign XML formats.
|
|
<p>
|
|
In addition to providing wrappers for existing elements and
|
|
attributes the <code>Path</code> annotations can be used to
|
|
provide an ordered set of elements. Order can be applied to the
|
|
elements created using an XPath index. For example.
|
|
<pre>
|
|
|
|
@Element
|
|
@Path("contact-info[1]/phone")
|
|
private String home;
|
|
|
|
@Element
|
|
@Path("contact-info[2]/phone")
|
|
private String office;
|
|
|
|
</pre>
|
|
In the above example we have two element annotations within a
|
|
single class. However each one is given an element path with
|
|
an index. This tells the serialization process that it should
|
|
generate two wrapping elements, ordered by the index specified.
|
|
The above annotations will result in the following.
|
|
<pre>
|
|
|
|
<contact-info>
|
|
<phone>
|
|
<home>1800123123</home>
|
|
</phone>
|
|
</contact-info>
|
|
<contact-info>
|
|
<phone>
|
|
<office>1800123123</office>
|
|
</phone>
|
|
</contact-info>
|
|
|
|
</pre>
|
|
On deserialization the references to fields are known, and
|
|
can be read from the order of the wrapping path elements.
|
|
This is useful if you need to read specific fields or methods
|
|
from an XML document that maintains elements in sequence. If
|
|
such sequences contain similarly named child elements, then
|
|
the <code>ElementList</code> annotation provides a better
|
|
alternative to indexed XPath expressions.
|
|
<P>
|
|
|
|
<P>
|
|
<DL>
|
|
<DT><B>Author:</B></DT>
|
|
<DD>Niall Gallagher</DD>
|
|
</DL>
|
|
<HR>
|
|
|
|
<P>
|
|
<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->
|
|
|
|
<A NAME="annotation_type_required_element_summary"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
|
<B>Required Element Summary</B></FONT></TH>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> java.lang.String</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../org/simpleframework/xml/Path.html#value()">value</A></B></CODE>
|
|
|
|
<BR>
|
|
This method is used to provide the XPath expression for the
|
|
annotation.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<P>
|
|
|
|
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
|
|
|
|
<A NAME="annotation_type_element_detail"><!-- --></A>
|
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
|
<B>Element Detail</B></FONT></TH>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<A NAME="value()"><!-- --></A><H3>
|
|
value</H3>
|
|
<PRE>
|
|
public abstract java.lang.String <B>value</B></PRE>
|
|
<DL>
|
|
<DD>This method is used to provide the XPath expression for the
|
|
annotation. Only a subset of expressions are supported. All
|
|
path formats can be parsed. However, if the path does not
|
|
match the supported expressions an exception will be thrown.
|
|
Some examples of the formats supported are shown below.
|
|
<pre>
|
|
|
|
./example/path
|
|
./example/path/
|
|
example/path
|
|
example[2]/path
|
|
|
|
</pre>
|
|
There is no limit to the level of nesting supported. Also
|
|
the <code>Order</code> annotation supports the above formats
|
|
so that nested elements can be order for serialization of
|
|
the fields and methods of the annotated types.
|
|
<P>
|
|
<DD><DL>
|
|
</DL>
|
|
</DD>
|
|
<DD><DL>
|
|
|
|
<DT><B>Returns:</B><DD>this returns an XPath expression for the location</DL>
|
|
</DL>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<HR>
|
|
|
|
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<A NAME="navbar_bottom"><!-- --></A>
|
|
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
<TR>
|
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
<TR ALIGN="center" VALIGN="top">
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
</EM>
|
|
</TD>
|
|
</TR>
|
|
|
|
<TR>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../org/simpleframework/xml/Order.html" title="annotation in org.simpleframework.xml"><B>PREV CLASS</B></A>
|
|
<A HREF="../../../org/simpleframework/xml/Root.html" title="annotation in org.simpleframework.xml"><B>NEXT CLASS</B></A></FONT></TD>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../index.html?org/simpleframework/xml/Path.html" target="_top"><B>FRAMES</B></A>
|
|
<A HREF="Path.html" target="_top"><B>NO FRAMES</B></A>
|
|
<SCRIPT type="text/javascript">
|
|
<!--
|
|
if(window==top) {
|
|
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
}
|
|
//-->
|
|
</SCRIPT>
|
|
<NOSCRIPT>
|
|
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
</NOSCRIPT>
|
|
|
|
|
|
</FONT></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
SUMMARY: <A HREF="#annotation_type_required_element_summary">REQUIRED</A> | OPTIONAL</FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD>
|
|
</TR>
|
|
</TABLE>
|
|
<A NAME="skip-navbar_bottom"></A>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
|
|
<HR>
|
|
|
|
</BODY>
|
|
</HTML>
|