LSParserFilters provide applications the ability to examine
nodes as they are being constructed while parsing. As each node is
examined, it may be modified or removed, or the entire parse may be
terminated early.
At the time any of the filter methods are called by the parser, the
owner Document and DOMImplementation objects exist and are accessible.
The document element is never passed to the LSParserFilter
methods, i.e. it is not possible to filter out the document element.
Document, DocumentType, Notation,
Entity, and Attr nodes are never passed to the
acceptNode method on the filter. The child nodes of an
EntityReference node are passed to the filter if the
parameter "
entities" is set to false. Note that, as described by the parameter "
entities", unexpanded entity reference nodes are never discarded and are always
passed to the filter.
All validity checking while parsing a document occurs on the source document as it appears on the input stream, not on the DOM document as it is built in memory. With filters, the document in memory may be a subset of the document on the stream, and its validity may have been affected by the filtering.
All default attributes must be present on elements when the elements are passed to the filter methods. All other default content must be passed to the filter methods.
DOM applications must not raise exceptions in a filter. The effect of throwing exceptions from a filter is DOM implementation dependent.
See also the Document Object Model (DOM) Level 3 Load and Save Specification.
| Field Summary | |
|---|---|
static short |
FILTER_ACCEPT
Accept the node. |
static short |
FILTER_INTERRUPT
Interrupt the normal processing of the document. |
static short |
FILTER_REJECT
Reject the node and its children. |
static short |
FILTER_SKIP
Skip this single node. |
| Method Summary | |
|---|---|
short |
acceptNode(Node nodeArg)
This method will be called by the parser at the completion of the parsing of each node. |
int |
getWhatToShow()
Tells the LSParser what types of nodes to show to the
method LSParserFilter.acceptNode. |
short |
startElement(Element elementArg)
The parser will call this method after each Element start
tag has been scanned, but before the remainder of the
Element is processed. |
| Field Detail |
|---|
static final short FILTER_ACCEPT
static final short FILTER_REJECT
static final short FILTER_SKIP
static final short FILTER_INTERRUPT
| Method Detail |
|---|
short startElement(Element elementArg)
Element start
tag has been scanned, but before the remainder of the
Element is processed. The intent is to allow the
element, including any children, to be efficiently skipped. Note that
only element nodes are passed to the startElement
function.
startElement for filtering
will include all of the Element's attributes, but none of the
children nodes. The Element may not yet be in place in the document
being constructed (it may not have a parent node.)
startElement filter function may access or change
the attributes for the Element. Changing Namespace declarations will
have no effect on namespace resolution by the parser.
elementArg - The newly encountered element. At the time this
method is called, the element is incomplete - it will have its
attributes, but no children.
FILTER_ACCEPT if the Element should
be included in the DOM document being built.
FILTER_REJECT if the Element and all of
its children should be rejected.
FILTER_SKIP if the
Element should be skipped. All of its children are
inserted in place of the skipped Element node.
FILTER_INTERRUPT if the filter wants to stop the
processing of the document. Interrupting the processing of the
document does no longer guarantee that the resulting DOM tree is
XML well-formed. The Element is rejected.
short acceptNode(Node nodeArg)
nodeArg - The newly constructed element. At the time this method
is called, the element is complete - it has all of its children
(and their children, recursively) and attributes, and is attached
as a child to its parent.
FILTER_ACCEPT if this Node should
be included in the DOM document being built.
FILTER_REJECT if the Node and all of its
children should be rejected.
FILTER_SKIP if the
Node should be skipped and the Node
should be replaced by all the children of the Node.
FILTER_INTERRUPT if the filter wants to stop the
processing of the document. Interrupting the processing of the
document does no longer guarantee that the resulting DOM tree is
XML well-formed. The Node is accepted and will be the
last completely parsed node.
int getWhatToShow()
LSParser what types of nodes to show to the
method LSParserFilter.acceptNode. If a node is not shown
to the filter using this attribute, it is automatically included in
the DOM document being built. See NodeFilter for
definition of the constants. The constants SHOW_ATTRIBUTE
, SHOW_DOCUMENT, SHOW_DOCUMENT_TYPE,
SHOW_NOTATION, SHOW_ENTITY, and
SHOW_DOCUMENT_FRAGMENT are meaningless here. Those nodes
will never be passed to LSParserFilter.acceptNode.
Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
7 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)