Top Description Fields Constructors Methods
com.sun.xml.txw2

pack-priv Class StartTag

extends Content
implements NamespaceResolver
Class Inheritance
All Implemented Interfaces
com.sun.xml.txw2.NamespaceResolver
Imports
javax.xml.namespace.QName

Start tag.

This object implements NamespaceResolver for attribute values.

Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
pack-priv final Document
private Attribute
private NamespaceDecl
firstNs

Explicitly given namespace declarations on this element.

private Attribute
private NamespaceDecl
private final String
private ContainerElement
owner

If this StartTag has the parent ContainerElement, that value.

private String
uri

Tag name of the element.

Constructor Summary

AccessConstructor and Description
public
StartTag(ContainerElement owner, String uri, String localName)

public
StartTag(Document document, String uri, String localName)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
accept(ContentVisitor visitor)

Implements abstract com.sun.xml.txw2.Content.accept.

Accepts a visitor.

public void
addAttribute(String nsUri, String localName, Object arg)

public NamespaceDecl
addNamespaceDecl(String
namespace URI to be bound. Can be empty, but must not be null.
uri
,
String
If non-null and non-empty, this prefix is bound to the URI on this element. If empty, then the runtime will still try to use the URI as the default namespace, but it may fail to do so because of the constraints in the XML.

If this parameter is null, the runtime will allocate an unique prefix.

prefix
,
boolean
Used only when the prefix parameter is null. If true, this indicates that the non-empty prefix must be assigned to this URI. If false, then this URI might be used as the default namespace.

Normally you just need to set it to false.

requirePrefix
)

Declares a new namespace URI on this tag.

private void
checkWritable()

Throws an error if the start tag has already been committed.

pack-priv boolean
concludesPendingStartTag()

Implements abstract com.sun.xml.txw2.Content.concludesPendingStartTag.

Returns true if this can guarantee that no more new namespace decls is necessary for the currently pending start tag.

public String
getPrefix(String nsUri)

Implements com.sun.xml.txw2.NamespaceResolver.getPrefix.

Allocates a prefix for the specified URI and returns it.

pack-priv boolean
isReadyToCommit()

Overrides com.sun.xml.txw2.Content.isReadyToCommit.

A can be only written after we are sure that all the necessary namespace declarations are given.

pack-priv boolean
isWritten()

Returns true if this start tag has already been written.

public void
written()

Overrides com.sun.xml.txw2.Content.written.

Called when this content is written to the output.

Inherited from com.sun.xml.txw2.Content:
getNextsetNext

Field Detail

documentback to summary
pack-priv final Document document
firstAttback to summary
private Attribute firstAtt
firstNsback to summary
private NamespaceDecl firstNs

Explicitly given namespace declarations on this element.

Additional namespace declarations might be necessary to generate child QNames and attributes.

lastAttback to summary
private Attribute lastAtt
lastNsback to summary
private NamespaceDecl lastNs
localNameback to summary
private final String localName
ownerback to summary
private ContainerElement owner

If this StartTag has the parent ContainerElement, that value. Otherwise null.

uriback to summary
private String uri

Tag name of the element.

This field is also used as a flag to indicate whether the start tag has been written. This field is initially set to non-null, and then reset to null when it's written.

Constructor Detail

StartTagback to summary
public StartTag(ContainerElement owner, String uri, String localName)
StartTagback to summary
public StartTag(Document document, String uri, String localName)

Method Detail

acceptback to summary
pack-priv void accept(ContentVisitor visitor)

Implements abstract com.sun.xml.txw2.Content.accept.

Doc from com.sun.xml.txw2.Content.accept.

Accepts a visitor.

Annotations
@Override
addAttributeback to summary
public void addAttribute(String nsUri, String localName, Object arg)
addNamespaceDeclback to summary
public NamespaceDecl addNamespaceDecl(String uri, String prefix, boolean requirePrefix)

Declares a new namespace URI on this tag.

Parameters
uri:String

namespace URI to be bound. Can be empty, but must not be null.

prefix:String

If non-null and non-empty, this prefix is bound to the URI on this element. If empty, then the runtime will still try to use the URI as the default namespace, but it may fail to do so because of the constraints in the XML.

If this parameter is null, the runtime will allocate an unique prefix.

requirePrefix:boolean

Used only when the prefix parameter is null. If true, this indicates that the non-empty prefix must be assigned to this URI. If false, then this URI might be used as the default namespace.

Normally you just need to set it to false.

checkWritableback to summary
private void checkWritable()

Throws an error if the start tag has already been committed.

concludesPendingStartTagback to summary
pack-priv boolean concludesPendingStartTag()

Implements abstract com.sun.xml.txw2.Content.concludesPendingStartTag.

Doc from com.sun.xml.txw2.Content.concludesPendingStartTag.

Returns true if this can guarantee that no more new namespace decls is necessary for the currently pending start tag.

Annotations
@Override
getPrefixback to summary
public String getPrefix(String nsUri)

Implements com.sun.xml.txw2.NamespaceResolver.getPrefix.

Doc from com.sun.xml.txw2.NamespaceResolver.getPrefix.

Allocates a prefix for the specified URI and returns it.

Annotations
@Override
isReadyToCommitback to summary
pack-priv boolean isReadyToCommit()

Overrides com.sun.xml.txw2.Content.isReadyToCommit.

A can be only written after we are sure that all the necessary namespace declarations are given.

Annotations
@Override
isWrittenback to summary
pack-priv boolean isWritten()

Returns true if this start tag has already been written.

writtenback to summary
public void written()

Overrides com.sun.xml.txw2.Content.written.

Doc from com.sun.xml.txw2.Content.written.

Called when this content is written to the output.

Annotations
@Override