org.apache.wicket.markup
Class MarkupResourceStream

java.lang.Object
  extended by org.apache.wicket.markup.MarkupResourceStream
All Implemented Interfaces:
Closeable, Serializable, IClusterable, IFixedLocationResourceStream, IResourceStream, IModifiable

public class MarkupResourceStream
extends Object
implements IResourceStream, IFixedLocationResourceStream

An IResourceStream implementation with specific extensions for markup resource streams.

Author:
Juergen Donnerstag
See Also:
Serialized Form

Field Summary
static String WICKET_XHTML_DTD
           
 
Constructor Summary
MarkupResourceStream(IResourceStream resourceStream)
          Construct.
MarkupResourceStream(IResourceStream resourceStream, ContainerInfo containerInfo, Class<?> markupClass)
          Construct.
 
Method Summary
 void close()
           
 Markup getBaseMarkup()
          In case of markup inheritance, the base markup resource.
 MarkupResourceStream getBaseMarkupResourceStream()
          Get the resource stream containing the base markup (markup inheritance)
 String getCacheKey()
          Gets cacheKey.
 ContainerInfo getContainerInfo()
          Get the container info associated with the markup
 String getContentType()
           
 String getDoctype()
          Gets doctype.
 String getEncoding()
          Gets the markup encoding.
 InputStream getInputStream()
           
 Locale getLocale()
           
 Class<? extends Component> getMarkupClass()
          Get the actual component class the markup is directly associated with.
 IResourceStream getResource()
          Gets the resource that contains this markup
 String getStyle()
           
 String getVariation()
           
 String getWicketId()
           
 String getWicketNamespace()
          Get the wicket namespace valid for this specific markup
 boolean isHtml5()
           
 Time lastModifiedTime()
           
 Bytes length()
           
 String locationAsString()
           
 void setBaseMarkup(Markup baseMarkup)
          In case of markup inheritance, the base markup.
 void setCacheKey(String cacheKey)
          Set the cache key
 void setDoctype(CharSequence doctype)
          Sets doctype.
 void setLocale(Locale locale)
           
 void setStyle(String style)
           
 void setVariation(String variation)
           
 void setWicketNamespace(String wicketNamespace)
          Sets wicketNamespace.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WICKET_XHTML_DTD

public static final String WICKET_XHTML_DTD
See Also:
Constant Field Values
Constructor Detail

MarkupResourceStream

public MarkupResourceStream(IResourceStream resourceStream)
Construct.

Parameters:
resourceStream -

MarkupResourceStream

public MarkupResourceStream(IResourceStream resourceStream,
                            ContainerInfo containerInfo,
                            Class<?> markupClass)
Construct.

Parameters:
resourceStream -
containerInfo -
markupClass -
Method Detail

locationAsString

public String locationAsString()
Specified by:
locationAsString in interface IFixedLocationResourceStream

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in interface IResourceStream
Throws:
IOException

getContentType

public String getContentType()
Specified by:
getContentType in interface IResourceStream

getInputStream

public InputStream getInputStream()
                           throws ResourceStreamNotFoundException
Specified by:
getInputStream in interface IResourceStream
Throws:
ResourceStreamNotFoundException

getLocale

public Locale getLocale()
Specified by:
getLocale in interface IResourceStream

lastModifiedTime

public Time lastModifiedTime()
Specified by:
lastModifiedTime in interface IModifiable

length

public Bytes length()
Specified by:
length in interface IResourceStream

setLocale

public void setLocale(Locale locale)
Specified by:
setLocale in interface IResourceStream

getMarkupClass

public Class<? extends Component> 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 info associated with the markup

Returns:
ContainerInfo

getCacheKey

public final String getCacheKey()
Gets cacheKey.

Returns:
cacheKey

setCacheKey

public final void setCacheKey(String cacheKey)
Set the cache key

Parameters:
cacheKey -

getResource

public IResourceStream getResource()
Gets the resource that contains this markup

Returns:
The resource where this markup came from

getEncoding

public String getEncoding()
Gets the markup encoding. A markup encoding may be specified in a markup file with an XML encoding specifier of the form <?xml ... encoding="..." ?>.

Returns:
Encoding, or null if not found.

getWicketNamespace

public String getWicketNamespace()
Get the wicket namespace valid for this specific markup

Returns:
wicket namespace

getWicketId

public final String getWicketId()
Returns:
usually it is "wicket:id"

setWicketNamespace

public final void setWicketNamespace(String wicketNamespace)
Sets wicketNamespace.

Parameters:
wicketNamespace - wicketNamespace

getBaseMarkupResourceStream

public MarkupResourceStream getBaseMarkupResourceStream()
Get the resource stream containing the base markup (markup inheritance)

Returns:
baseMarkupResource Null, if not base markup

setBaseMarkup

public void setBaseMarkup(Markup baseMarkup)
In case of markup inheritance, the base markup.

Parameters:
baseMarkup - The base markup

getBaseMarkup

public Markup getBaseMarkup()
In case of markup inheritance, the base markup resource.

Returns:
The base markup

getStyle

public String getStyle()
Specified by:
getStyle in interface IResourceStream

getVariation

public String getVariation()
Specified by:
getVariation in interface IResourceStream

setStyle

public void setStyle(String style)
Specified by:
setStyle in interface IResourceStream

setVariation

public void setVariation(String variation)
Specified by:
setVariation in interface IResourceStream

toString

public String toString()
Overrides:
toString in class Object

getDoctype

public final String getDoctype()
Gets doctype.

Returns:
The doctype excluding 'DOCTYPE'

setDoctype

public final void setDoctype(CharSequence doctype)
Sets doctype.

Parameters:
doctype - doctype

isHtml5

public boolean isHtml5()
Returns:
True, if doctype == <!DOCTYPE html>
See Also:
DOCTYPE


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.