Package org.apache.maven.building
Class StringSource
java.lang.Object
org.apache.maven.building.StringSource
- All Implemented Interfaces:
- Source
- Direct Known Subclasses:
- StringModelSource,- StringSettingsSource
Wraps an ordinary 
CharSequence as a source.- Author:
- Benjamin Bentmann
- 
Constructor SummaryConstructorsConstructorDescriptionStringSource(CharSequence content) Creates a new source backed by the specified string.StringSource(CharSequence content, String location) Creates a new source backed by the specified string.
- 
Method Summary
- 
Constructor Details- 
StringSourceCreates a new source backed by the specified string.- Parameters:
- content- The String representation, may be empty or- null.
 
- 
StringSourceCreates a new source backed by the specified string.- Parameters:
- content- The String representation, may be empty or- null.
- location- The location to report for this use, may be- null.
 
 
- 
- 
Method Details- 
getInputStreamDescription copied from interface:SourceGets a byte stream to the source contents. Closing the returned stream is the responsibility of the caller.- Specified by:
- getInputStreamin interface- Source
- Returns:
- A byte stream to the source contents, never null.
- Throws:
- IOException- in case of IO issue
 
- 
getLocationDescription copied from interface:SourceProvides a user-friendly hint about the location of the source. This could be a local file path, a URI or just an empty string. The intention is to assist users during error reporting.- Specified by:
- getLocationin interface- Source
- Returns:
- A user-friendly hint about the location of the source, never null.
 
- 
getContentGets the content of this source.- Returns:
- The underlying character stream, never null.
 
- 
toString
- 
hashCodepublic int hashCode()
- 
equals
 
-