Package org.apache.wicket.markup
Class MarkupResourceStream
- java.lang.Object
-
- org.apache.wicket.markup.MarkupResourceStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,org.apache.wicket.util.io.IClusterable,org.apache.wicket.util.resource.IFixedLocationResourceStream,org.apache.wicket.util.resource.IResourceStream,org.apache.wicket.util.watch.IModifiable
public class MarkupResourceStream extends java.lang.Object implements org.apache.wicket.util.resource.IResourceStream, org.apache.wicket.util.resource.IFixedLocationResourceStreamAn IResourceStream implementation with specific extensions for markup resource streams.- Author:
- Juergen Donnerstag
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringWICKET_XHTML_DTD
-
Constructor Summary
Constructors Constructor Description MarkupResourceStream(org.apache.wicket.util.resource.IResourceStream resourceStream)Construct.MarkupResourceStream(org.apache.wicket.util.resource.IResourceStream resourceStream, ContainerInfo containerInfo, java.lang.Class<?> markupClass)Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()MarkupgetBaseMarkup()In case of markup inheritance, the base markup resource.MarkupResourceStreamgetBaseMarkupResourceStream()Get the resource stream containing the base markup (markup inheritance)java.lang.StringgetCacheKey()Gets cacheKey.ContainerInfogetContainerInfo()Get the container info associated with the markupjava.lang.StringgetContentType()java.lang.StringgetDoctype()Gets doctype.java.lang.StringgetEncoding()Gets the markup encoding.java.io.InputStreamgetInputStream()java.util.LocalegetLocale()java.lang.Class<? extends Component>getMarkupClass()Get the actual component class the markup is directly associated with.org.apache.wicket.util.resource.IResourceStreamgetResource()Gets the resource that contains this markupjava.lang.StringgetStyle()java.lang.StringgetVariation()java.lang.StringgetWicketId()java.lang.StringgetWicketNamespace()Get the wicket namespace valid for this specific markupbooleanisHtml5()org.apache.wicket.util.time.TimelastModifiedTime()org.apache.wicket.util.lang.Byteslength()java.lang.StringlocationAsString()voidsetBaseMarkup(Markup baseMarkup)In case of markup inheritance, the base markup.voidsetCacheKey(java.lang.String cacheKey)Set the cache keyvoidsetDoctype(java.lang.CharSequence doctype)Sets doctype.voidsetLocale(java.util.Locale locale)voidsetStyle(java.lang.String style)voidsetVariation(java.lang.String variation)voidsetWicketNamespace(java.lang.String wicketNamespace)Sets wicketNamespace.java.lang.StringtoString()
-
-
-
Field Detail
-
WICKET_XHTML_DTD
public static final java.lang.String WICKET_XHTML_DTD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MarkupResourceStream
public MarkupResourceStream(org.apache.wicket.util.resource.IResourceStream resourceStream)
Construct.- Parameters:
resourceStream-
-
MarkupResourceStream
public MarkupResourceStream(org.apache.wicket.util.resource.IResourceStream resourceStream, ContainerInfo containerInfo, java.lang.Class<?> markupClass)Construct.- Parameters:
resourceStream-containerInfo-markupClass-
-
-
Method Detail
-
locationAsString
public java.lang.String locationAsString()
- Specified by:
locationAsStringin interfaceorg.apache.wicket.util.resource.IFixedLocationResourceStream
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceorg.apache.wicket.util.resource.IResourceStream- Throws:
java.io.IOException
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfaceorg.apache.wicket.util.resource.IResourceStream
-
getInputStream
public java.io.InputStream getInputStream() throws org.apache.wicket.util.resource.ResourceStreamNotFoundException- Specified by:
getInputStreamin interfaceorg.apache.wicket.util.resource.IResourceStream- Throws:
org.apache.wicket.util.resource.ResourceStreamNotFoundException
-
getLocale
public java.util.Locale getLocale()
- Specified by:
getLocalein interfaceorg.apache.wicket.util.resource.IResourceStream
-
lastModifiedTime
public org.apache.wicket.util.time.Time lastModifiedTime()
- Specified by:
lastModifiedTimein interfaceorg.apache.wicket.util.watch.IModifiable
-
length
public org.apache.wicket.util.lang.Bytes length()
- Specified by:
lengthin interfaceorg.apache.wicket.util.resource.IResourceStream
-
setLocale
public void setLocale(java.util.Locale locale)
- Specified by:
setLocalein interfaceorg.apache.wicket.util.resource.IResourceStream
-
getMarkupClass
public java.lang.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 java.lang.String getCacheKey()
Gets cacheKey.- Returns:
- cacheKey
-
setCacheKey
public final void setCacheKey(java.lang.String cacheKey)
Set the cache key- Parameters:
cacheKey-
-
getResource
public org.apache.wicket.util.resource.IResourceStream getResource()
Gets the resource that contains this markup- Returns:
- The resource where this markup came from
-
getEncoding
public java.lang.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 java.lang.String getWicketNamespace()
Get the wicket namespace valid for this specific markup- Returns:
- wicket namespace
-
getWicketId
public final java.lang.String getWicketId()
- Returns:
- usually it is "wicket:id"
-
setWicketNamespace
public final void setWicketNamespace(java.lang.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 java.lang.String getStyle()
- Specified by:
getStylein interfaceorg.apache.wicket.util.resource.IResourceStream
-
getVariation
public java.lang.String getVariation()
- Specified by:
getVariationin interfaceorg.apache.wicket.util.resource.IResourceStream
-
setStyle
public void setStyle(java.lang.String style)
- Specified by:
setStylein interfaceorg.apache.wicket.util.resource.IResourceStream
-
setVariation
public void setVariation(java.lang.String variation)
- Specified by:
setVariationin interfaceorg.apache.wicket.util.resource.IResourceStream
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getDoctype
public final java.lang.String getDoctype()
Gets doctype.- Returns:
- The doctype excluding 'DOCTYPE'
-
setDoctype
public final void setDoctype(java.lang.CharSequence doctype)
Sets doctype.- Parameters:
doctype- doctype
-
isHtml5
public boolean isHtml5()
- Returns:
- True, if doctype == <!DOCTYPE html>
- See Also:
- DOCTYPE
-
-