All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.tv.locator.LocatorFactory Maven / Gradle / Ivy

The newest version!
/*
 * @(#)LocatorFactory.java	1.24 00/10/09
 *
 * Copyright 1998-2000 by Sun Microsystems, Inc.,
 * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
 * All rights reserved.
 * 
 * This software is the confidential and proprietary information
 * of Sun Microsystems, Inc. ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Sun.
 */

package javax.tv.locator;


/**
 * This class defines a factory for the creation of
 * Locator objects.
 *
 * @see javax.tv.locator.Locator */
public abstract class LocatorFactory {

  private static LocatorFactory theLocatorFactory = null;

  /**
   * Creates the LocatorFactory instance.
   */
  protected LocatorFactory() {}

  /**
   * Provides an instance of LocatorFactory.
   * 
   * @return A LocatorFactory instance.
   */
  public static LocatorFactory getInstance() {
	if (theLocatorFactory != null) {
		return theLocatorFactory;
	}

	try {
		theLocatorFactory = new com.sun.tv.LocatorFactoryImpl();

	} catch (Exception e) {
		;
	}

	return theLocatorFactory;
  }

  /**
   * Creates a Locator object from the specified locator
   * string.  The format of the locator string may be entirely
   * implementation-specific.
   *
   * @param locatorString The string form of the Locator
   * to be created.  The created Locator will have an
   * external form that is identical to locatorString.
   *
   * @return A Locator object representing the resource
   * referenced by the given locator string.
   *
   * @throws MalformedLocatorException If an incorrectly formatted
   * locator string is detected.
   *
   * @see Locator#toExternalForm */
  public abstract Locator createLocator(String locatorString)
      throws MalformedLocatorException;
  
  /**
   * Transforms a Locator into its respective collection
   * of transport dependent Locator objects. A
   * transformation on a transport dependent Locator
   * results in an identity transformation, i.e. the same locator is
   * returned in a single-element array.
   *
   * @param source The Locator to transform.
   *
   * @return An array of transport dependent Locator
   * objects for the given Locator.
   * 
   * @throws InvalidLocatorException If source is not a valid
   * Locator.  */
  public abstract Locator[] transformLocator(Locator source)
      throws InvalidLocatorException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy