## org.eclipse.ocl
Class OCLInput

    java.lang.Object
      org.eclipse.ocl.OCLInput

    public final class OCLInput

extends Object

Encapsulation of an OCL document, which may be obtained from a string or from a stream. The content of the OCL document consists of one or more context declarations (including constraints) with optional package declarations.

Constructor Summary
`OCLInput(InputStream oclStream)` Creates an OCL document from an input stream, using the default character set to decode it.
`OCLInput(InputStream oclStream, String encoding)` Creates an OCL document from an input stream in the specified encoding.
`OCLInput(Reader oclReader)` Creates an OCL document from a character stream.
`OCLInput(String oclText)` Creates an OCL document from a string.

Method Summary
`char[]` `getContent()` The contents of the OCL document as a character array, suitable for consumption by the OCL parser.
`Reader` `getContentAsStream()` The contents of the OCL document as a character stream, suitable for consumption by the OCL parser.
`String` `getContentAsString()` The contents of the OCL document as a character array, suitable for consumption by the OCL parser.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OCLInput

    public OCLInput(String oclText)

  Creates an OCL document from a string.

  Parameters:
    `oclText` - the string containing the OCL document

### OCLInput

    public OCLInput(InputStream oclStream)

  Creates an OCL document from an input stream, using the default character set to decode it.

  Parameters:
    `oclStream` - the input stream providing the OCL document

### OCLInput

    public OCLInput(InputStream oclStream,
                    String encoding)
             throws UnsupportedEncodingException

  Creates an OCL document from an input stream in the specified encoding.

  Parameters:
    `oclStream` - the input stream providing the OCL document
    `encoding` - the stream's character encoding
  Throws:
    `UnsupportedEncodingException` - if the specified encoding is not supported in this virtual machine

### OCLInput

    public OCLInput(Reader oclReader)

  Creates an OCL document from a character stream.

  Parameters:
    `oclReader` - the stream providing the OCL document

Method Detail

### getContent

    public char[] getContent()
                      throws ParserException

  The contents of the OCL document as a character array, suitable for consumption by the OCL parser.

  Returns:
    the OCL document contents
  Throws:
    `ParserException` - on an I/O failure in reading the content

### getContentAsString

    public String getContentAsString()
                              throws ParserException

  The contents of the OCL document as a character array, suitable for consumption by the OCL parser.

  Returns:
    the OCL document contents
  Throws:
    `ParserException` - on an I/O failure in reading the content

### getContentAsStream

    public Reader getContentAsStream()

  The contents of the OCL document as a character stream, suitable for consumption by the OCL parser.

  Returns:
    the OCL document contents

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.