    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.pics.parser.Profile

    java.lang.Object
       |
       +----w3c.pics.parser.Profile

public class Profile
extends Object
implements Serializable, Cloneable

A class that represents a PICSRules 1.1 Profile.

##

Profile()
  Creates a new, empty Profile.

##

checkAll(Vector)
  checkAll returns a Vector of EvalResults, one for each of the URLs.
clone()
  The Clone method for Profiles.
evalURL(String)
  Evaluates whether a single url is allowed or not; first fetches any labels from label bureaus that the profile specifies to fetch.
getAuthor()
  Returns the author of this Profile.
getCreationTool()
  Returns the value of the CreationTool attribute of this Profile.
getDescription()
  Returns the description of this Profile.
getFullServiceName(String)
  Searches for the service name, given the Shortname of the service, as it appears in a Policy clause, for example.
getLabels(String)
  For each service, get embedded labels and label bureau labels.
getLastModified()
  Returns the last modified date of this Profile.
getOptExt()
  Returns a Vector containing String representations of all the optional extensions defined in this Profile.
getPolicies()
  Returns a Vector containing all of the information contained in the Policy clauses.
getReqExt()
  Returns a Vector containing String representations of all the required extensions defined in this Profile.
getRuleName()
  Returns the name of this Profile.
getServiceInfo(String)
  Returns a single ServiceInfo clause from this Profile.
getServiceNames()
  Returns an Enumeration containing all of the names of the ServiceInfo clauses.
getSourceURL()
  Returns the SourceURL of this Profile.
getVersion()
  Returns the version of PICSRules that this profile was created for.
isValid(String, Label)
  Evaluates a label against this Profile.
isValid(String, Label, boolean)
  Evaluates a label against this Profile.
isValid(String, Vector)
  Evaluates a group of labels against this Profile.
isValid(String, Vector, boolean)
  Evaluates a group of labels against this Profile.
isValidWithReason(String, Vector, boolean)
  Evaluates a group of labels against this Profile.
printResults(Vector, Vector)
  Matches URLs and results up one by one and nicely prints the results to System.out.
toString()
  Returns the PICSRules 1.1 representation of this Profile.

##

Profile

     public Profile()

  Creates a new, empty Profile.

##

getVersion

     public String getVersion()

  Returns the version of PICSRules that this profile was created for.

  Returns:
    A String containing the version information.

getRuleName

     public String getRuleName()

  Returns the name of this Profile.

  Returns:
    A String containing the name of this Profile.

getDescription

     public String getDescription()

  Returns the description of this Profile.

  Returns:
    A String containing the description of this Profile.

getSourceURL

     public String getSourceURL()

  Returns the SourceURL of this Profile.

  Returns:
    A String containing the SourceURL of this Profile.

getCreationTool

     public String getCreationTool()

  Returns the value of the CreationTool attribute of this Profile.

  Returns:
    A String containing the value of the CreationTool attribute.

getAuthor

     public String getAuthor()

  Returns the author of this Profile.

  Returns:
    A String containing the author of the Profile.

getLastModified

     public String getLastModified()

  Returns the last modified date of this Profile.

  Returns:
    A String containing the last modified date of this Profile.

getServiceInfo

     public Hashtable getServiceInfo(String serviceName)

  Returns a single ServiceInfo clause from this Profile.

  Parameters:
    serviceName - The name of the ServiceInfo clause to return.
  Returns:
    A Hashtable containing the information for the ServiceInfo clause with name serviceName

getFullServiceName

     public String getFullServiceName(String shortName)

  Searches for the service name, given the Shortname of the service, as it appears in a Policy clause, for example.

  Parameters:
    shortName - The shortname to lookup.

getServiceNames

     public Enumeration getServiceNames()

  Returns an Enumeration containing all of the names of the ServiceInfo clauses.

  Returns:
    An Enumeration.

getPolicies

     public Vector getPolicies()

  Returns a Vector containing all of the information contained in the Policy clauses.

  Returns:
    A Vector

getOptExt

     public Vector getOptExt()

  Returns a Vector containing String representations of all the optional extensions defined in this Profile.

  Returns:
    A Vector.

getReqExt

     public Vector getReqExt()

  Returns a Vector containing String representations of all the required extensions defined in this Profile.

  Returns:
    A Vector.

printResults

     public void printResults(Vector URLs,
                              Vector results)

  Matches URLs and results up one by one and nicely prints the results to System.out.

  Parameters:
    URLs - The URLs to be printed.
    results - A Vector containing the results for each URL.

checkAll

     public Vector checkAll(Vector URLs)

  checkAll returns a Vector of EvalResults, one for each of the URLs.

  Parameters:
    URLs - A Vector containing the URLs to evaluate.
  Returns:
    A Vector of EvalResults.

evalURL

     public EvalResult evalURL(String url)

  Evaluates whether a single url is allowed or not; first fetches any labels from label bureaus that the profile specifies to fetch.

  Parameters:
    url - The URL to evaluate.
  Returns:
    An EvalResult.

getLabels

     public void getLabels(String url)

  For each service, get embedded labels and label bureau labels.

  Parameters:
    url - The URL to be evaluated.

isValid

     public boolean isValid(String URL,
                            Label label)

  Evaluates a label against this Profile.

  Parameters:
    URL - The URL that the label rates.
    label - The label to evaluate against.
  Returns:
    A boolean, indicating if the label was passed or blocked by this profile.

isValid

     public boolean isValid(String URL,
                            Vector labellist)

  Evaluates a group of labels against this Profile.

  Parameters:
    URL - The URL that the labels rate.
    labellist - A Vector containing the labels to evaluate against.
  Returns:
    A boolean, indicating if this group of labels was passed or blocked by this profile.

isValid

     public boolean isValid(String URL,
                            Label label,
                            boolean debugmode)

  Evaluates a label against this Profile.

  Parameters:
    URL - The URL that the label rates.
    label - The label to evaluate against.
    debugmode - A boolean indicating if debugging output should be printed or not.
  Returns:
    A boolean, indicating if the label was passed or blocked by this profile.

isValid

     public boolean isValid(String URL,
                            Vector labellist,
                            boolean debugmode)

  Evaluates a group of labels against this Profile.

  Parameters:
    URL - The URL that the labels rate.
    labellist - A Vector containing the labels to evaluate against.
    debugmode - A boolean indicating if debugging output should be printed or not.
  Returns:
    A boolean, indicating if this group of labels was passed or blocked by this profile.

isValidWithReason

     public EvalResult isValidWithReason(String URL,
                                         Vector labellist,
                                         boolean debugmode)

  Evaluates a group of labels against this Profile.

  Parameters:
    URL - The URL that the labels rate.
    labellist - A Vector containing the labels to evaluate against.
    debugmode - A boolean indicating if debugging output should be printed or not.
  Returns:
    A Vector containing a Boolean and a String. The Boolean indicates whether or not this group of labels was passed or blocked by this profile. The String contains the reason why, taken from the Explanation sub-clause of the Policy clause that caused the passing/blocking.

toString

     public String toString()

  Returns the PICSRules 1.1 representation of this Profile.

  Returns:
    A String containing the PICSRules 1.1 representation of this Profile.
  Overrides:
    toString in class Object

clone

     public Object clone() throws CloneNotSupportedException

  The Clone method for Profiles.

  Returns:
    A duplicate of this Profile, as an Object.
  Throws: CloneNotSupportedException
    If the cloning fails.
  Overrides:
    clone in class Object

    All Packages  Class Hierarchy  This Package  Previous  Next  Index