Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.hivemind.util
Class AbstractResource  view AbstractResource download AbstractResource.java

java.lang.Object
  extended byorg.apache.hivemind.util.AbstractResource
All Implemented Interfaces:
org.apache.hivemind.Resource
Direct Known Subclasses:
ClasspathResource, ContextResource, FileResource, URLResource

public abstract class AbstractResource
extends java.lang.Object
implements org.apache.hivemind.Resource

Abstract implementation of org.apache.hivemind.Resource.

Resource instances act as a kind of factory for new instances of the same type, via newResource(String) 55 .


Field Summary
private  java.lang.String _folderPath
           
private  java.util.Locale _locale
           
private  java.lang.String _name
           
private  java.lang.String _path
           
 
Constructor Summary
protected AbstractResource(java.lang.String path)
           
protected AbstractResource(java.lang.String path, java.util.Locale locale)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the other object is an instance of the same class, and the paths are equal.
 java.util.Locale getLocale()
          Returns the locale for which this resource has been localized or null if the resource has not been localized.
 java.lang.String getName()
          Returns the file name portion of the resource location.
 java.lang.String getPath()
          Returns the path that represents the resource.
 org.apache.hivemind.Resource getRelativeResource(java.lang.String name)
          Returns at a relative location to this resource.
protected abstract  org.apache.hivemind.Resource newResource(java.lang.String path)
           
private  void split()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hivemind.Resource
getLocalization, getResourceURL
 

Field Detail

_path

private java.lang.String _path

_name

private java.lang.String _name

_folderPath

private java.lang.String _folderPath

_locale

private java.util.Locale _locale
Constructor Detail

AbstractResource

protected AbstractResource(java.lang.String path)

AbstractResource

protected AbstractResource(java.lang.String path,
                           java.util.Locale locale)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: org.apache.hivemind.Resource
Returns the file name portion of the resource location.

Specified by:
getName in interface org.apache.hivemind.Resource

getRelativeResource

public org.apache.hivemind.Resource getRelativeResource(java.lang.String name)
Description copied from interface: org.apache.hivemind.Resource
Returns at a relative location to this resource. The new resource may or may not exist; this can be determined via Resource.getResourceURL()>Resource.getResourceURL() 55 .

Specified by:
getRelativeResource in interface org.apache.hivemind.Resource

getPath

public java.lang.String getPath()
Description copied from interface: org.apache.hivemind.Resource
Returns the path that represents the resource. This should only be used when the type of resource is known.

Specified by:
getPath in interface org.apache.hivemind.Resource

getLocale

public java.util.Locale getLocale()
Description copied from interface: org.apache.hivemind.Resource
Returns the locale for which this resource has been localized or null if the resource has not been localized. This should only be used when the type of resource is known. This locale is the same or more general than the locale for which localization was requested. For example, if the requested locale was en_US, but only the file Home_en was found, this locale returned would be en.

Specified by:
getLocale in interface org.apache.hivemind.Resource

newResource

protected abstract org.apache.hivemind.Resource newResource(java.lang.String path)

split

private void split()

equals

public boolean equals(java.lang.Object obj)
Returns true if the other object is an instance of the same class, and the paths are equal.