Overview | Package | Class | Tree | Deprecated | Index | Help
| Qizx/Open v0.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.xfra.qizxopen.util
Class NSPrefixMapping

    java.lang.Object
      |
      +--net.xfra.qizxopen.util.NSPrefixMapping

public class NSPrefixMapping
extends java.lang.Object

Mapping of Namespace prefixes.

This simple implementation with linear search is sufficient if we consider that rarely more than a few NS are defined in practice.

Field Summary
`static NSPrefixMapping` | `std`

Constructor Summary
`NSPrefixMapping()`

Method Summary
`void` | `addMapping(java.lang.String prefix, Namespace ns)`
`void` | `addMapping(java.lang.String prefix, java.lang.String uri)`
`Namespace` | `convertToNamespace(java.lang.String prefix)` Returns the most recent NS matching the prefix.
`java.lang.String` | `convertToPrefix(Namespace ns)` Returns the most recent prefix matching the NS.
`NSPrefixMapping` | `copy()`
`QName` | `expandName(java.lang.String name)` Converts a prefixed name into a QName.
`static java.lang.String` | `extractLocalName(java.lang.String name)`
`static java.lang.String` | `extractPrefix(java.lang.String name)`
`Namespace` | `getLastNamespace(int rankFromTop)` Returns a declared namespace.
`java.lang.String` | `getLastPrefix(int rankFromTop)` Returns a declared prefix.
`int` | `getMappingCount()`
`java.lang.String` | `prefixedName(QName name)` Converts a QName into a prefixed name.
`void` | `removeMappings(int count)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### std

    public static NSPrefixMapping std

Constructor Detail

### NSPrefixMapping

    public NSPrefixMapping()

Method Detail

### copy

    public NSPrefixMapping copy()

### addMapping

    public void addMapping(java.lang.String prefix,
                           java.lang.String uri)

### addMapping

    public void addMapping(java.lang.String prefix,
                           Namespace ns)

### getMappingCount

    public int getMappingCount()

### removeMappings

    public void removeMappings(int count)

### convertToNamespace

    public Namespace convertToNamespace(java.lang.String prefix)

  Returns the most recent NS matching the prefix.

### convertToPrefix

    public java.lang.String convertToPrefix(Namespace ns)

  Returns the most recent prefix matching the NS.

### extractPrefix

    public static java.lang.String extractPrefix(java.lang.String name)

### extractLocalName

    public static java.lang.String extractLocalName(java.lang.String name)

### expandName

    public QName expandName(java.lang.String name)

  Converts a prefixed name into a QName.

  Returns:
    null if the prefix is not defined, the expanded QName otherwise.

### prefixedName

    public java.lang.String prefixedName(QName name)

  Converts a QName into a prefixed name.

### getLastPrefix

    public java.lang.String getLastPrefix(int rankFromTop)

  Returns a declared prefix. The last declared prefix has rank 1, the previous 2 etc.

### getLastNamespace

    public Namespace getLastNamespace(int rankFromTop)

  Returns a declared namespace. The last declared namespace has rank 1, the previous 2 etc.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright Xavier FRANC 2003-2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD