public static CacheableYamlSource sourceFromString(
        final String identity,
        final String content,
        final Date modified,
        final ValidationSet validation
    )
    {
        return new CacheableYamlSource() {
            @Override
            public boolean isValid() {
                return true;
            }

            @Override
            public Date getLastModified() {
                return modified;
            }

            @Override
            public String getIdentity() {
                return identity;
            }

            @Override
            public Iterable<ACLPolicyDoc> loadAll(final Yaml yaml) throws IOException {
                return YamlParsePolicy.documentIterable(yaml.loadAll(content).iterator(), validation, identity);
            }

            @Override
            public ValidationSet getValidationSet() {
                return validation;
            }

            @Override
            public void close() throws IOException {

            }
        };
    }
public static CacheableYamlSource sourceFromString ( final String identity , final String content , final Date modified , final ValidationSet validation ) { return new CacheableYamlSource ( ) { @ Override public boolean isValid ( ) { return true ; } @ Override public Date getLastModified ( ) { return modified ; } @ Override public String getIdentity ( ) { return identity ; } @ Override public Iterable < ACLPolicyDoc > loadAll ( final Yaml yaml ) throws IOException { return YamlParsePolicy . documentIterable ( yaml . loadAll ( content ) . iterator ( ) , validation , identity ) ; } @ Override public ValidationSet getValidationSet ( ) { return validation ; } @ Override public void close ( ) throws IOException { } } ; }
Source from a stream

@param identity identity
@param content  yaml string
@param modified date the content was last modified, for caching purposes

@return source