com.bluecast.xml

Class FastNamespaceSupport


public class FastNamespaceSupport
extends java.lang.Object

This class improves performance over NamespaceSupport by assuming that most XML documents have very few namespaces. Therefore, instead of performing expensive copying operations of hash tables, arrays and linear searches are used instead.

NOTE: This class is not a drop-in replacement for NamespaceSupport. This class assumes that passed URIs are already internalized! Also, getURI() returns "" instead of null if a prefix is not found.

Version:
$Revision: 1.5 $
Author:
Yuval Oren

Field Summary

static String
XMLNS

Constructor Summary

FastNamespaceSupport()

Method Summary

void
declarePrefix(String prefix, String uri)
String
getContextPrefix(int index)
int
getContextSize()
String
getContextURI(int index)
String
getDefaultURI()
String
getURI(String prefix)
void
popContext()
String[]
processName(String qName, parts[] , boolean isAttribute)
void
pushContext()
void
reset()

Field Details

XMLNS

public static final String XMLNS

Constructor Details

FastNamespaceSupport

public FastNamespaceSupport()

Method Details

declarePrefix

public void declarePrefix(String prefix,
                          String uri)

getContextPrefix

public String getContextPrefix(int index)

getContextSize

public int getContextSize()

getContextURI

public String getContextURI(int index)

getDefaultURI

public String getDefaultURI()

getURI

public String getURI(String prefix)

popContext

public void popContext()

processName

public String[] processName(String qName,
                            parts[] ,
                            boolean isAttribute)

pushContext

public void pushContext()

reset

public void reset()