org.xwt
Class Res

java.lang.Object
  extended byorg.xwt.js.JS
      extended byorg.xwt.Res
Direct Known Subclasses:
Res.Builtin, Res.ByteArray, Res.Cab, Res.CachedRes, Res.File, Res.Graft, Res.HTTP, Res.ProgressWatcher, Res.Ref, Res.Zip

public abstract class Res
extends JS

base class for XWT resources


Nested Class Summary
static class Res.Builtin
          the Builtin resource
static class Res.ByteArray
          byte arrays
static class Res.Cab
          "unwrap" a Cab archive
static class Res.CachedRes
          subclass from this if you want a CachedInputStream for each path
static class Res.File
          a file
static class Res.Graft
          shadow resource which replaces the graft
static class Res.HTTP
          HTTP or HTTPS resource
static class Res.ProgressWatcher
          shadow resource which replaces the graft
static class Res.Ref
          what you get when you reference a subresource
static class Res.Zip
          "unwrap" a Zip archive
 
Nested classes inherited from class org.xwt.js.JS
JS.Array, JS.Callable, JS.Context, JS.Exn, JS.GlobalScope, JS.Obj, JS.Scope, JS.TailCall
 
Field Summary
 Template t
           
 
Constructor Summary
Res()
           
 
Method Summary
 Res addExtension(java.lang.String extension)
          if the path of this resource does not end with extension, return a new one wit it appended
 java.lang.Object callMethod(java.lang.Object method, JS.Array args, boolean checkOnly)
           
 java.lang.Object get(java.lang.Object key)
           
abstract  java.lang.String getDescriptiveName()
           
 java.io.InputStream getInputStream()
          returns an InputStream containing the Resource's contents
abstract  java.io.InputStream getInputStream(java.lang.String path)
           
 Res getParent()
           
 Res graft(java.lang.Object newResource)
          graft newResource in place of this resource on its parent
 java.lang.Object[] keys()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object val)
           
static Res stringToRes(java.lang.String url)
           
 java.lang.String typeName()
           
 void writeTo(java.io.OutputStream os)
           
 
Methods inherited from class org.xwt.js.JS
coerceToBoolean, coerceToNumber, coerceToString, parse, toBoolean, toDouble, toInt, toLong, toNumber, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

t

public Template t
Constructor Detail

Res

public Res()
Method Detail

getDescriptiveName

public abstract java.lang.String getDescriptiveName()

typeName

public java.lang.String typeName()
Overrides:
typeName in class JS

getParent

public Res getParent()

getInputStream

public final java.io.InputStream getInputStream()
                                         throws java.io.IOException
returns an InputStream containing the Resource's contents

Throws:
java.io.IOException

getInputStream

public abstract java.io.InputStream getInputStream(java.lang.String path)
                                            throws java.io.IOException
Throws:
java.io.IOException

graft

public Res graft(java.lang.Object newResource)
graft newResource in place of this resource on its parent


addExtension

public Res addExtension(java.lang.String extension)
if the path of this resource does not end with extension, return a new one wit it appended


keys

public java.lang.Object[] keys()
Specified by:
keys in class JS

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object val)
Specified by:
put in class JS

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in class JS

stringToRes

public static Res stringToRes(java.lang.String url)

callMethod

public java.lang.Object callMethod(java.lang.Object method,
                                   JS.Array args,
                                   boolean checkOnly)
                            throws JS.Exn
Overrides:
callMethod in class JS
Throws:
JS.Exn

writeTo

public void writeTo(java.io.OutputStream os)
             throws java.io.IOException
Throws:
java.io.IOException