Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.ide.net
Class DefaultURLFilter

java.lang.Object
  extended by oracle.ide.net.DefaultURLFilter
All Implemented Interfaces:
URLFilter

public class DefaultURLFilter
extends java.lang.Object
implements URLFilter

A default implementation of URLFilter that performs filtering based on file extensions. If no extensions are associated with the URLFilter, then the URLFilter will accept all URLs.


Constructor Summary
DefaultURLFilter(java.lang.String description)
          Creates a new filter with the associated description.
DefaultURLFilter(java.lang.String description, java.lang.String extension)
          Creates a new filter with the associated description and the extension that is to be accepted by this filter.
DefaultURLFilter(java.lang.String description, java.lang.String[] extensions)
          Creates a new filter with the associated description and the extension that is to be accepted by this filter.
 
Method Summary
 boolean accept(java.net.URL url)
           
 void addExtension(java.lang.String extension)
          Adds the specified extension to the list of extensions that are accepted by this filter.
 boolean equals(java.lang.Object o)
          A concrete URLFilter must provide an implementation for the equals(...) method that compares the URLFilter to another one.
protected  boolean equalsImpl(DefaultURLFilter filter)
           
 void setDescription(java.lang.String description)
          Sets the description of this URLFilter instance that will be shown to the user.
 java.lang.String toString()
          Returns the display string that is shown when the user is looking at a list of URLFilters to choose from.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultURLFilter

public DefaultURLFilter(java.lang.String description)
Creates a new filter with the associated description. The filter is initialized to accept all URLs.


DefaultURLFilter

public DefaultURLFilter(java.lang.String description,
                        java.lang.String extension)
Creates a new filter with the associated description and the extension that is to be accepted by this filter. If the specified extension is null or the empty string, then this filter will be initially configured to accept all URLs.

Parameters:
description - A description of what this filter represents. The description will be displayed to the user.
extension - The extension to filter for. The extension string must begin with a '.' if the '.' is part of the extension. If the extension is null or the empty string, then this filter will be initialized to accept all URLs.

DefaultURLFilter

public DefaultURLFilter(java.lang.String description,
                        java.lang.String[] extensions)
Creates a new filter with the associated description and the extension that is to be accepted by this filter. If the specified extension is null or the empty string, then this filter will be configured to accept all URLs. If any of the extensions in the specified array are null or the empty string, they will be skipped.

Parameters:
description - A description of what this filter represents. The description will be displayed to the user.
extensions - The extensions to filter for. The extension strings must each begin with a '.' if the '.' is part of the accepted extension.
Method Detail

addExtension

public void addExtension(java.lang.String extension)
Adds the specified extension to the list of extensions that are accepted by this filter. The extension must begin with a '.' character, if the '.' character is actually part of the extension.

Parameters:
extension - The extension to accept. For example ".jar", ".java", ".gif", etc.

setDescription

public void setDescription(java.lang.String description)
Sets the description of this URLFilter instance that will be shown to the user. The string set on this method will be part of what is returned in the toString() method.


accept

public boolean accept(java.net.URL url)
Specified by:
accept in interface URLFilter
Parameters:
url - The URL that is being filtered.
Returns:
true if this filter allows the specified URL is allowed to be displayed or included. Returns false otherwise.

equals

public boolean equals(java.lang.Object o)
Description copied from interface: URLFilter
A concrete URLFilter must provide an implementation for the equals(...) method that compares the URLFilter to another one. A return value of true means that both this URLFilter and the specified URLFilter will accept identical sets of URLs and that the descriptions used to identify the filters are equal.

Specified by:
equals in interface URLFilter
Overrides:
equals in class java.lang.Object

equalsImpl

protected final boolean equalsImpl(DefaultURLFilter filter)

toString

public java.lang.String toString()
Returns the display string that is shown when the user is looking at a list of URLFilters to choose from. The string is composed of the description, followed by a list of the associated extensions in parentheses. If no extensions are associated then "*.*" is shown in the parentheses.

Specified by:
toString in interface URLFilter
Overrides:
toString in class java.lang.Object

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.