atomSource = element atom:source { atomCommonAttributes, (atomAuthor & atomCategory & atomContributor & atomGenerator? & atomIcon? & atomId? & atomLink & atomLogo? & atomRights? & atomSubtitle? & atomTitle? & atomUpdated? & extensionElement*) }
The RSS channel that the item came from. More.
<source> is an optional sub-element of <item>.
Its value is the name of the RSS channel that the item came from, derived from its <title>. It has one required attribute, url, which links to the XMLization of the source.
<source url="http://www.tomalak.org/links2.xml">Tomalak's Realm</source>
The purpose of this element is to propagate credit for links, to publicize the sources of news items. It can be used in the Post command of an aggregator. It should be generated automatically when forwarding an item from an aggregator to a weblog authoring tool.
@author Bill BrownImplementations of this interface need to be aware of some assumptions made by the analysis engine concerning sources:
If the instances that implement this API are the system of record, then they will typically be unique. In that case, sources that are created that represent non-existent files must also be retained so that if those files are created at a later date the long-lived sources representing those files will know that they now exist. @coverage dart.engine.source
@author Alejandro Abdelnur
@author Alejandro Abdelnur
Must be disposed to ensure that the readers are closed and the file free for other uses. Does not need to be disposed if a byte array is used.
pathRoot
, the relativePath
, the shortName
, which is often the class name, the owner, which specifies where the Source came from, and whether the Source
is internal, root, and debuggable.
@author Clement Wong
The first step in parsing an HTML document is always to construct a Source
object from the source data, which can be a String
, Reader
, InputStream
, URLConnection
or URL
. Each constructor uses all the evidence available to determine the original {@linkplain #getEncoding() character encoding} of the data.
Once the Source
object has been created, you can immediately start searching for {@linkplain Tag tags} or {@linkplain Element elements} within the documentusing the tag search methods.
In certain circumstances you may be able to improve performance by calling the {@link #fullSequentialParse()} method before calling anytag search methods. See the documentation of the {@link #fullSequentialParse()} method for details.
Any issues encountered while parsing are logged to a {@link Logger} object.The {@link #setLogger(Logger)} method can be used to explicitly set a Logger
implementation for a particular Source
instance,otherwise the static {@link Config#LoggerProvider} property determines how the logger is set by default for all Source
instances.See the documentation of the {@link Config#LoggerProvider} property for information about how the default logging provider is determined.
Note that many of the useful functions which can be performed on the source document are defined in its superclass, {@link Segment}. The source object is itself a segment which spans the entire document.
Most of the methods defined in this class are useful for determining the elements and tags surrounding or neighbouring a particular character position in the document.
For information on how to create a modified version of this source document, see the {@link OutputDocument} class.
Source
objects are not thread safe, and should therefore not be shared between multiple threads unless all access is synchronized using some mechanism external to the library.
If memory usage is a major concern, consider using the {@link StreamedSource} class instead of the Source
class.
@see Segment
@see StreamedSource
Per RFC4287:
If an atom:entry is copied from one feed into another feed, then the source atom:feed's metadata (all child elements of atom:feed other than the atom:entry elements) MAY be preserved within the copied entry by adding an atom:source child element, if it is not already present in the entry, and including some or all of the source feed's Metadata elements as the atom:source element's children. Such metadata SHOULD be preserved if the source atom:feed contains any of the child elements atom:author, atom:contributor, atom:rights, or atom:category and those child elements are not present in the source atom:entry. atomSource = element atom:source { atomCommonAttributes, (atomAuthor & atomCategory & atomContributor & atomGenerator? & atomIcon? & atomId? & atomLink & atomLogo? & atomRights? & atomSubtitle? & atomTitle? & atomUpdated? & extensionElement*) } The atom:source element is designed to allow the aggregation of entries from different feeds while retaining information about an entry's source feed. For this reason, Atom Processors that are performing such aggregation SHOULD include at least the required feed-level Metadata elements (atom:id, atom:title, and atom:updated) in the atom:source element.
When the Source
object is no longer needed it must be released using the {@link SourceResolver}. This is very similar to looking up components from a ServiceSelector
. In fact a source object can implement most lifecycle interfaces like Composable, Initializable, Disposable etc.
The data content can be constant or change over time. Using the {@link #getInputStream()} method you get always the up-to-date content.
If you want to track changes of the source object, this interface offers you some support for it by providing a SourceValidity object.
How does the caching work? The first time you get a Source object, you simply ask it for it's content via getInputStream() and then get the validity object by invoking getValidity. (Further calls to getValidity always return the same object! This is not updated!) The caching algorithm can now store this validity object together with the system identifier of the source. The next time, the caching algorithm wants to check if the cached content is still valid. It has a validity object already to check against.
If it is still the same Source than the first time, you have to call refresh() in order to discard the stored validity in the Source object. If it is a new Source object, calling refresh() should do no harm. After that an up-to-date validity object can retrieved by calling getValidity(). This can be used to test if the content is still valid as discribed in the source validity documentation. If the content is still valid, the cache knows what to do, if not, the new content can be get using getInputStream(). So either after a call to getValidity() or the getInputStream the validity object must be the same until refresh is called! @author Avalon Development Team @version CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:26 $
A source generates {@plainlink Event events} and calls methods on theconfigured {@link ChannelProcessor} to persist those events into theconfigured {@linkplain Channel channels}.
Sources are associated with unique {@linkplain NamedComponent names} that canbe used for separating configuration and working namespaces.
No guarantees are given regarding thread safe access.
@see org.apache.flume.Channel @see org.apache.flume.SinkThe following features are supported:
new InputStreamReader (connection.getInputStream (), charset)It differs from the above, in three ways:
create
is called when a client of the manager wants to retrieve a mapper object associated with this source, giving the opportunity to the source object to prepare resources for the mapper release
is called when the client no longer needs the mapper.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|