de.smartics.properties.api.core.context.alias
Class PropertyAliasMapping

Package class diagram package PropertyAliasMapping
java.lang.Object
  extended by de.smartics.properties.api.core.context.alias.PropertyAliasMapping
All Implemented Interfaces:
Serializable

@NotThreadSafe
public final class PropertyAliasMapping
     
     
extends Object
implements Serializable

The mapping of alias names of property reports to their physical names. The physical names are those file names that are stored in the META-INF folder or on the server in the case of HTML reports. The alias names are alternative, unique naming schemes that refer to the same files.

See Also:
Serialized Form

Constructor Summary
PropertyAliasMapping()
          Default constructor.
 
Method Summary
 void add(String alias, String target)
          Adds a new alias to the given physical resource.
 String get(String alias)
          Returns the target the alias points to.
 boolean has(String alias)
          Checks if the given alias is registered.
 boolean isEmpty()
          Checks whether any aliases are registered.
 void traverse(AliasTraverser traverser)
          Traverses the registered aliases.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyAliasMapping

public PropertyAliasMapping()
Default constructor.

Method Detail

add

public void add(String alias,
                String target)
         throws de.smartics.util.lang.BlankArgumentException,
                DuplicateAliasException
Adds a new alias to the given physical resource.

Parameters:
alias - the new alias.
target - the resource the alias refers to.
Throws:
de.smartics.util.lang.BlankArgumentException - if either alias or target is blank.
DuplicateAliasException - if there is already an alias registered that points to a different physical resource.

has

public boolean has(String alias)
            throws de.smartics.util.lang.BlankArgumentException
Checks if the given alias is registered.

Parameters:
alias - the alias to check.
Returns:
true if the alias is known to the system, false otherwise.
Throws:
de.smartics.util.lang.BlankArgumentException - if alias is blank.

get

public String get(String alias)
           throws de.smartics.util.lang.BlankArgumentException,
                  UnknownAliasException
Returns the target the alias points to.

Parameters:
alias - the alias whose physical resource is requested.
Returns:
the target the alias points to.
Throws:
de.smartics.util.lang.BlankArgumentException - if alias is blank.
UnknownAliasException - if the alias is not known.

traverse

public void traverse(AliasTraverser traverser)
              throws NullPointerException
Traverses the registered aliases.

Parameters:
traverser - the traverser to use.
Throws:
NullPointerException - if traverser is null.

isEmpty

public boolean isEmpty()
Checks whether any aliases are registered.

Returns:
false if at least one alias is registered, true otherwise.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.