org.ckkloverdos.source
Class SourceTypeRegistry

java.lang.Object
  extended by org.ckkloverdos.source.SourceTypeRegistry

public class SourceTypeRegistry
extends java.lang.Object

A registry for source types.

Author:
Christos KK Loverdos
See Also:
SourceType

Constructor Summary
SourceTypeRegistry()
           
 
Method Summary
 java.lang.String[] getExtensionsForType(java.lang.String name)
          Returns the extensions associated with the type of the given name.
 SourceType getTypeFromExt(java.lang.String extension)
          Returns the type associated with the given extension.
 SourceType getTypeFromName(java.lang.String name)
          Returns the type associated with the given name.
 SourceType register(java.lang.String name, java.lang.String extension)
          Registers a type for the given name and extension.
 SourceType register(java.lang.String name, java.lang.String[] extensions)
          Registers a type for the given name and extensions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceTypeRegistry

public SourceTypeRegistry()
Method Detail

register

public SourceType register(java.lang.String name,
                           java.lang.String extension)
Registers a type for the given name and extension. If a type with the same name exists, then the extension is registered for the existing type and that one is returned.

Parameters:
name -
extension -

register

public SourceType register(java.lang.String name,
                           java.lang.String[] extensions)
Registers a type for the given name and extensions. If a type with the same name exists, then the extensions are registered for the existing type and that one is returned.

Parameters:
name -
extensions -

getTypeFromExt

public SourceType getTypeFromExt(java.lang.String extension)
Returns the type associated with the given extension.

Parameters:
extension -

getTypeFromName

public SourceType getTypeFromName(java.lang.String name)
Returns the type associated with the given name.

Parameters:
name -

getExtensionsForType

public java.lang.String[] getExtensionsForType(java.lang.String name)
Returns the extensions associated with the type of the given name.

Parameters:
name -
Returns:
the extensions or an empty array if none is found.


Copyright © 1999-2007 Christos KK Loverdos. All Rights Reserved.