-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathILink.java
More file actions
162 lines (129 loc) · 4.49 KB
/
ILink.java
File metadata and controls
162 lines (129 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/* Copyright (c) 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.gdata.data;
import com.google.gdata.util.ContentType;
import com.google.gdata.util.Namespaces;
/**
* Common interface for Links.
*
*
*/
public interface ILink extends Reference {
/**
* The Rel class defines constants for some common link relation types.
*/
public static final class Rel {
/**
* Link provides the URI of the feed or entry. If this
* relation appears on a feed that is the result of performing a
* query, then this URI includes the same query parameters (or at
* least querying this URI produces the same result as querying with
* those parameters).
*/
public static final String SELF = "self";
/** Link provides the URI of previous page in a paged feed. */
public static final String PREVIOUS = "previous";
/** Link provides the URI of next page in a paged feed. */
public static final String NEXT = "next";
/**
* Link provides the URI of an alternate format of the
* entry's or feed's contents. The {@code type} property of the link
* specifies a media type.
*/
public static final String ALTERNATE = "alternate";
/**
* Link provides the URI of a related link to the entry
*/
public static final String RELATED = "related";
/**
* Link provides the URI of the full feed (without any
* query parameters).
*/
public static final String FEED = Namespaces.gPrefix + "feed";
/**
* Link provides the URI that can be used to post new
* entries to the feed. This relation does not exist if the feed is
* read-only.
*/
public static final String ENTRY_POST = Namespaces.gPrefix + "post";
/**
* Link provides the URI that can be used to edit the entry.
* This relation does not exist if the entry is read-only.
*/
public static final String ENTRY_EDIT = "edit";
/**
* Link provides the URI that can be used to edit the media
* associated with an entry. This relation does not exist if
* there is no associated media or the media is read-only.
*/
public static final String MEDIA_EDIT = "edit-media";
/**
* Previous media edit link relation value that will temporarily be
* supported to enable back compatibility for Picasa Web. This rel
* will be deleted after all usage has been migrated to use
* {@link #MEDIA_EDIT}.
*
* @deprecated use {@link Rel#MEDIA_EDIT} instead.
*/
@Deprecated
public static final String MEDIA_EDIT_BACKCOMPAT = "media-edit";
/**
* Link provides the URI that can be used to insert, update
* and delete entries on this feed. This relation does not exist
* if the feed is read-only or if batching not enabled on this
* feed.
*/
public static final String FEED_BATCH = Namespaces.gPrefix + "batch";
/**
* Link provides the URI that of link that provides the data
* for the content in the feed.
*/
public static final String VIA = "via";
/**
* Relation for links to enclosure (podcasting) files.
*/
public static final String ENCLOSURE = "enclosure";
private Rel() {}
}
/**
* The Type class contains several common link content types.
*/
public static final class Type {
/** Defines the link type used for Atom content. */
public static final String ATOM = ContentType.ATOM.getMediaType();
/** Defines the link type used for HTML content. */
public static final String HTML = ContentType.TEXT_HTML.getMediaType();
private Type() {}
}
/**
* Returns the link relation type. Common values are defined in the
* {@link Rel} class.
*
* @see Rel
*/
public String getRel();
/**
* Sets the link relation type.
*/
public void setRel(String rel);
/**
* Returns the mime type of the link.
*/
public String getType();
/**
* Sets the mime type of the link.
*/
public void setType(String type);
}