NetKernel APIs


com.ten60.netkernel.urii.aspect
Class StringAspect

java.lang.Object
  extended bycom.ten60.netkernel.urii.aspect.StringAspect
All Implemented Interfaces:
IAspectBinaryStream, IAspectReadableBinaryStream, IAspectReader, IAspectString, IURAspect
Direct Known Subclasses:
StringAspect

public class StringAspect
extends Object
implements IAspectReadableBinaryStream, IAspectString

Implementation of IAspectString and IAspectReadableBinaryStream that holds a java.lang.String


Constructor Summary
StringAspect(String aString)
          Creates a new instance of StringAspect
StringAspect(String aString, String aEncoding)
          Creates a new instance of StringAspect
 
Method Summary
static IURRepresentation create(IURMeta aMeta, String aString)
          Deprecated.  
 int getContentLength()
          Return the length of the stream
 String getEncoding()
           
 InputStream getInputStream()
          Return an input stream to read the data
 Reader getReader()
          Return reader over string
 String getString()
          Return the string
 void write(OutputStream aStream)
          Write state to OutputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringAspect

public StringAspect(String aString)
Creates a new instance of StringAspect

Parameters:
aString - the value for the aspect

StringAspect

public StringAspect(String aString,
                    String aEncoding)
Creates a new instance of StringAspect

Parameters:
aString - the value for the aspect
aEncoding - the prefered character encoding for writing
Method Detail

getString

public String getString()
Return the string

Specified by:
getString in interface IAspectString

write

public void write(OutputStream aStream)
           throws IOException
Write state to OutputStream

Specified by:
write in interface IAspectBinaryStream
Parameters:
aStream - the output stream
Throws:
IOException - thrown if we fail to write

getContentLength

public int getContentLength()
Return the length of the stream

Specified by:
getContentLength in interface IAspectReadableBinaryStream

getInputStream

public InputStream getInputStream()
                           throws IOException
Return an input stream to read the data

Specified by:
getInputStream in interface IAspectReadableBinaryStream
Throws:
IOException

create

public static IURRepresentation create(IURMeta aMeta,
                                       String aString)
Deprecated.  

Create an IURRepresentation holding the StringAspect

Parameters:
aMeta - the meta for the representation
aString - the value of the string aspect

getEncoding

public String getEncoding()
Specified by:
getEncoding in interface IAspectBinaryStream

getReader

public Reader getReader()
Description copied from interface: IAspectReader
Return reader over string

Specified by:
getReader in interface IAspectReader

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.