public DocumentParseResult parse(String[] document) {
			DocumentParseResult result = new DocumentParseResult(document.length);
			CrudRepository<BaseDefinition, String> transientRepository = new TransientDefinitionRepository();
			StreamConfigParser parser = new StreamConfigParser(transientRepository);
			int line = 1;
			for (String nameAndDefinitionPair : document) {
				try {
					StreamNode stream = parser.parse(nameAndDefinitionPair);
					String streamName = stream.getStreamName();
					if (streamName == null) {
						// Give the stream a placeholder name as none was supplied. Someone
						// processing the parse result should know this can happen.
						streamName = "UNKNOWN_" + line;
					}
					List<Exception> errorAccumulator = new ArrayList<Exception>();
					List<ModuleDescriptor> moduleDescriptors = delegate.buildModuleDescriptors(streamName,
							nameAndDefinitionPair, ParsingContext.partial_stream, stream, errorAccumulator);
					BaseDefinition streamDefinition = new StreamDefinition(streamName, nameAndDefinitionPair);
					transientRepository.save(streamDefinition);
					result.success(moduleDescriptors, errorAccumulator);
				}
				catch (Exception e) {
					result.failure(e);
				}
				line++;
			}
			return result;
		}
A wrapper around the canonical parser that supports multiline "document" parsing.

<p>While XDStreamParser parses a single definition, this class is able to parse multiple, reporting
errors or accepting constructs like taps against definitions that appear earlier in the document (without
actually saving them in the main repository).</p>

@author Eric Bottard
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/stream/XDStreamParser.java