NetKernel APIs


com.ten60.netkernel.urii.aspect
Class StringAspect

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

public class StringAspect
extends java.lang.Object
implements IAspectReadableBinaryStream, IAspectString

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


Constructor Summary
StringAspect(java.lang.String aString)
          Creates a new instance of StringAspect
StringAspect(java.lang.String aString, java.lang.String aEncoding)
          Creates a new instance of StringAspect
 
Method Summary
static IURRepresentation create(IURMeta aMeta, java.lang.String aString)
          Deprecated.  
 int getContentLength()
          Return the length of the stream
 java.lang.String getEncoding()
           
 java.io.InputStream getInputStream()
          Return an input stream to read the data
 java.io.Reader getReader()
          Return reader over string
 java.lang.String getString()
          Return the string
 void write(java.io.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(java.lang.String aString)
Creates a new instance of StringAspect

Parameters:
aString - the value for the aspect

StringAspect

public StringAspect(java.lang.String aString,
                    java.lang.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 java.lang.String getString()
Return the string

Specified by:
getString in interface IAspectString

write

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

Specified by:
write in interface IAspectBinaryStream
Parameters:
aStream - the output stream
Throws:
java.io.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 java.io.InputStream getInputStream()
                                   throws java.io.IOException
Return an input stream to read the data

Specified by:
getInputStream in interface IAspectReadableBinaryStream
Throws:
java.io.IOException

create

public static IURRepresentation create(IURMeta aMeta,
                                       java.lang.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 java.lang.String getEncoding()
Specified by:
getEncoding in interface IAspectBinaryStream

getReader

public java.io.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.