ubiware.core
Class ConditionalResourcePrefixer

java.lang.Object
  extended by ubiware.core.ConditionalResourcePrefixer

public class ConditionalResourcePrefixer
extends java.lang.Object

resourcePrefixer with memory about the namespaces it has been using. furthermore, it only prefixes in case it is initialized to do that. 23.6.2010

Author:
Michael Cochez for UBIWARE project

Constructor Summary
ConditionalResourcePrefixer(ResourcePrefixer prefixer, boolean prefix)
          Construct a conditional resourcePrefixer.
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getUsedNameSpaces()
          returns a HashMap containing all namespaces used by this prefixer in prefix-url form
 java.lang.String prefixResource(java.lang.String resource)
          Prefixes the given resource and if a previously not used namespace is used, it will be remembered by this prefixer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionalResourcePrefixer

public ConditionalResourcePrefixer(ResourcePrefixer prefixer,
                                   boolean prefix)
Construct a conditional resourcePrefixer.

Parameters:
prefixer - the actual prefixer able to do prefixing.
prefix - only if true, prefixing will be done
Method Detail

prefixResource

public java.lang.String prefixResource(java.lang.String resource)
Prefixes the given resource and if a previously not used namespace is used, it will be remembered by this prefixer.

Parameters:
resource - the resource which should be prefixed
Returns:
the prefixed representation of the resource

getUsedNameSpaces

public java.util.Map<java.lang.String,java.lang.String> getUsedNameSpaces()
returns a HashMap containing all namespaces used by this prefixer in prefix-url form

Returns:
The map of namespaces which have been used.