org.norther.tammi.spray.terminal.profile
Class UnmodifiableProfile

java.lang.Object
  extended by org.norther.tammi.spray.terminal.profile.UnmodifiableProfile
All Implemented Interfaces:
Serializable, Profile

public class UnmodifiableProfile
extends Object
implements Profile, Serializable

An unmodifiable implementation of Profile.

Version:
$Id: UnmodifiableProfile.java,v 1.4 2010-03-15 15:49:38 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Constructor Summary
UnmodifiableProfile(Profile profile)
          Constructs a new profile.
 
Method Summary
 void addContentTypes(Collection<MimeType> types)
          Adds more content types to this profile.
 void addHostPatterns(Collection<Pattern> patterns)
          Adds more host patterns.
 void addUserAgentPatterns(Collection<Pattern> patterns)
          Adds more user agent patterns.
 void clearContentTypes()
          Clears content types of this profile..
 void clearHostPatterns()
          Clears all host patterns.
 void clearUserAgentPatterns()
          Clears all user agent patterns.
 List<MimeType> getContentTypes()
          Gets content types of this profile.
 Integer getHeight()
          Gets the height in pixels.
 List<Pattern> getHostPatterns()
          Gets host patterns.
 String getName()
          Gets the name.
protected  Profile getProfile()
          Gets the profile adaptee.
 Boolean getScriptable()
          Gets whether scriptable.
 List<Pattern> getUserAgentPatterns()
          Gets user agent patterns.
 Integer getWidth()
          Gets the width in pixels.
 boolean matchHost(String host)
          Matches the given host against this profile.
 boolean matchUserAgent(String agent)
          Matches the given user agent against this profile.
 boolean mergeContentTypes(Collection<List<MimeType>> mimes)
          Merges content types of this profile and its defaults.
 void removeContentType(MimeType type)
          Removes a content type from this profile.
 void removeHostPattern(Pattern pattern)
          Removes a host pattern.
 void removeUserAgentPattern(Pattern pattern)
          Removes a user agent pattern.
 void setContentTypes(List<MimeType> types)
          Sets content types of this profile.
 void setHeight(Integer h)
          Sets the height in pixels.
 void setHostPatterns(List<Pattern> patterns)
          Sets host patterns.
 void setScriptable(Boolean state)
          Sets whether scriptable.
 void setUserAgentPatterns(List<Pattern> patterns)
          Sets user agent patterns.
 void setWidth(Integer w)
          Sets the width.in pixels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnmodifiableProfile

public UnmodifiableProfile(Profile profile)
Constructs a new profile.

Parameters:
profile - the profile adaptee.
Method Detail

getName

public String getName()
Description copied from interface: Profile
Gets the name.

Specified by:
getName in interface Profile
Returns:
the name.

getScriptable

public Boolean getScriptable()
Description copied from interface: Profile
Gets whether scriptable.

Specified by:
getScriptable in interface Profile
Returns:
the scriptable state.

setScriptable

public void setScriptable(Boolean state)
Description copied from interface: Profile
Sets whether scriptable.

Specified by:
setScriptable in interface Profile
Parameters:
state - the scriptable state.

getWidth

public Integer getWidth()
Description copied from interface: Profile
Gets the width in pixels.

Specified by:
getWidth in interface Profile
Returns:
the width.

setWidth

public void setWidth(Integer w)
Description copied from interface: Profile
Sets the width.in pixels

Specified by:
setWidth in interface Profile
Parameters:
w - the width.

getHeight

public Integer getHeight()
Description copied from interface: Profile
Gets the height in pixels.

Specified by:
getHeight in interface Profile
Returns:
the height.

setHeight

public void setHeight(Integer h)
Description copied from interface: Profile
Sets the height in pixels.

Specified by:
setHeight in interface Profile
Parameters:
h - the height.

getContentTypes

public List<MimeType> getContentTypes()
Description copied from interface: Profile
Gets content types of this profile.

Specified by:
getContentTypes in interface Profile
Returns:
a read-only set of content types or null.

setContentTypes

public void setContentTypes(List<MimeType> types)
Description copied from interface: Profile
Sets content types of this profile.

Specified by:
setContentTypes in interface Profile
Parameters:
types - a set of content types.

addContentTypes

public void addContentTypes(Collection<MimeType> types)
Description copied from interface: Profile
Adds more content types to this profile.

Specified by:
addContentTypes in interface Profile
Parameters:
types - a collection of content types.

removeContentType

public void removeContentType(MimeType type)
Description copied from interface: Profile
Removes a content type from this profile.

Specified by:
removeContentType in interface Profile
Parameters:
type - a comma separated value of content types.

clearContentTypes

public void clearContentTypes()
Description copied from interface: Profile
Clears content types of this profile..

Specified by:
clearContentTypes in interface Profile

mergeContentTypes

public boolean mergeContentTypes(Collection<List<MimeType>> mimes)
Description copied from interface: Profile
Merges content types of this profile and its defaults.

Specified by:
mergeContentTypes in interface Profile
Parameters:
mimes - the result collection.
Returns:
true to continue merge, false to break.

getUserAgentPatterns

public List<Pattern> getUserAgentPatterns()
Description copied from interface: Profile
Gets user agent patterns.

Specified by:
getUserAgentPatterns in interface Profile
Returns:
a read-only set of patterns or null.

setUserAgentPatterns

public void setUserAgentPatterns(List<Pattern> patterns)
Description copied from interface: Profile
Sets user agent patterns.

Specified by:
setUserAgentPatterns in interface Profile
Parameters:
patterns - a set of patterns.

addUserAgentPatterns

public void addUserAgentPatterns(Collection<Pattern> patterns)
Description copied from interface: Profile
Adds more user agent patterns.

Specified by:
addUserAgentPatterns in interface Profile
Parameters:
patterns - a collection of patterns.

removeUserAgentPattern

public void removeUserAgentPattern(Pattern pattern)
Description copied from interface: Profile
Removes a user agent pattern.

Specified by:
removeUserAgentPattern in interface Profile
Parameters:
pattern - a user agent pattern.

clearUserAgentPatterns

public void clearUserAgentPatterns()
Description copied from interface: Profile
Clears all user agent patterns.

Specified by:
clearUserAgentPatterns in interface Profile

matchUserAgent

public boolean matchUserAgent(String agent)
Description copied from interface: Profile
Matches the given user agent against this profile.

Specified by:
matchUserAgent in interface Profile
Parameters:
agent - the user agent.
Returns:
true if matched, false otherwise.

getHostPatterns

public List<Pattern> getHostPatterns()
Description copied from interface: Profile
Gets host patterns.

Specified by:
getHostPatterns in interface Profile
Returns:
a read-only set of patterns or null.

setHostPatterns

public void setHostPatterns(List<Pattern> patterns)
Description copied from interface: Profile
Sets host patterns.

Specified by:
setHostPatterns in interface Profile
Parameters:
patterns - a set of patterns.

addHostPatterns

public void addHostPatterns(Collection<Pattern> patterns)
Description copied from interface: Profile
Adds more host patterns.

Specified by:
addHostPatterns in interface Profile
Parameters:
patterns - a collection of patterns.

removeHostPattern

public void removeHostPattern(Pattern pattern)
Description copied from interface: Profile
Removes a host pattern.

Specified by:
removeHostPattern in interface Profile
Parameters:
pattern - a host pattern.

clearHostPatterns

public void clearHostPatterns()
Description copied from interface: Profile
Clears all host patterns.

Specified by:
clearHostPatterns in interface Profile

matchHost

public boolean matchHost(String host)
Description copied from interface: Profile
Matches the given host against this profile.

Specified by:
matchHost in interface Profile
Parameters:
host - the host name.
Returns:
true if matched, false otherwise.

getProfile

protected Profile getProfile()
Gets the profile adaptee.

Returns:
the adaptee.


Copyright © 2004 The Norther Organization. All rights reserved.