wicket.markup
Class MarkupResourceStream

java.lang.Object
  extended by wicket.markup.MarkupResourceStream
All Implemented Interfaces:
java.io.Serializable, IResourceStream, IModifiable

public class MarkupResourceStream
extends java.lang.Object
implements IResourceStream

An IResourceStream implementation with specific extensions for markup resource streams.

Author:
Juergen Donnerstag
See Also:
Serialized Form

Constructor Summary
MarkupResourceStream(IResourceStream resourceStream, ContainerInfo containerInfo, java.lang.Class markupClass)
          Construct.
 
Method Summary
 void close()
          Closes the resource.
 ContainerInfo getContainerInfo()
          Get the container infos associated with the markup
 java.lang.String getContentType()
          Gets the mime type of this resource
 java.io.InputStream getInputStream()
          Gets the resource stream.
 java.util.Locale getLocale()
           
 java.lang.Class getMarkupClass()
          Get the actual component class the markup is directly associated with.
 Time lastModifiedTime()
          Gets the last time this modifiable thing changed.
 long length()
          Gets the size of this resource
 void setLocale(java.util.Locale locale)
          This method shouldn't be used for the outside, It is used by the Loaders to set the resolved locale.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MarkupResourceStream

public MarkupResourceStream(IResourceStream resourceStream,
                            ContainerInfo containerInfo,
                            java.lang.Class markupClass)
Construct.

Parameters:
resourceStream -
containerInfo -
markupClass -
Method Detail

close

public void close()
           throws java.io.IOException
Description copied from interface: IResourceStream
Closes the resource. Normally, this includes closing any underlying input stream returned by getInputStream().

Specified by:
close in interface IResourceStream
Throws:
java.io.IOException
See Also:
IResourceStream.close()

getContentType

public java.lang.String getContentType()
Description copied from interface: IResourceStream
Gets the mime type of this resource

Specified by:
getContentType in interface IResourceStream
Returns:
The mime type of this resource, such as "image/jpeg" or "text/html"
See Also:
IResourceStream.getContentType()

getInputStream

public java.io.InputStream getInputStream()
                                   throws ResourceStreamNotFoundException
Description copied from interface: IResourceStream
Gets the resource stream. You should not directly close this stream. Instead call the close() method on IResourceStream.

Specified by:
getInputStream in interface IResourceStream
Returns:
Returns the inputStream.
Throws:
ResourceStreamNotFoundException
See Also:
IResourceStream.getInputStream()

getLocale

public java.util.Locale getLocale()
Specified by:
getLocale in interface IResourceStream
Returns:
The Locale where this stream did resolve to
See Also:
IResourceStream.getLocale()

lastModifiedTime

public Time lastModifiedTime()
Description copied from interface: IModifiable
Gets the last time this modifiable thing changed.

Specified by:
lastModifiedTime in interface IModifiable
Returns:
The last modification time.
See Also:
IModifiable.lastModifiedTime()

length

public long length()
Description copied from interface: IResourceStream
Gets the size of this resource

Specified by:
length in interface IResourceStream
Returns:
The size of this resource in the number of bytes
See Also:
IResourceStream.length()

setLocale

public void setLocale(java.util.Locale locale)
Description copied from interface: IResourceStream
This method shouldn't be used for the outside, It is used by the Loaders to set the resolved locale.

Specified by:
setLocale in interface IResourceStream
Parameters:
locale - The Locale where this stream did resolve to.
See Also:
IResourceStream.setLocale(java.util.Locale)

getMarkupClass

public java.lang.Class getMarkupClass()
Get the actual component class the markup is directly associated with. Note: it not necessarily must be the container class.

Returns:
The directly associated class

getContainerInfo

public ContainerInfo getContainerInfo()
Get the container infos associated with the markup

Returns:
ContainerInfo

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2004-2007 Wicket developers. All Rights Reserved.