Class MetadataResource

  • All Implemented Interfaces:
    Resource

    public class MetadataResource
    extends java.lang.Object
    implements Resource
    Created by mike on 28/10/15.
    • Constructor Summary

      Constructors 
      Constructor Description
      MetadataResource​(java.lang.String resourceURI, Resource content, java.util.Map<java.lang.String,​GroundedValue> properties)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentType()
      Get the media type (MIME type) of the resource if known
      Item getItem​(XPathContext context)
      Get an XDM Item holding the contents of this resource.
      java.lang.String getResourceURI()
      Get a URI that identifies this resource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MetadataResource

        public MetadataResource​(java.lang.String resourceURI,
                                Resource content,
                                java.util.Map<java.lang.String,​GroundedValue> properties)
    • Method Detail

      • getContentType

        public java.lang.String getContentType()
        Description copied from interface: Resource
        Get the media type (MIME type) of the resource if known
        Specified by:
        getContentType in interface Resource
        Returns:
        the media type if known; otherwise null
      • getResourceURI

        public java.lang.String getResourceURI()
        Description copied from interface: Resource
        Get a URI that identifies this resource
        Specified by:
        getResourceURI in interface Resource
        Returns:
        a URI identifying this resource
      • getItem

        public Item getItem​(XPathContext context)
        Description copied from interface: Resource
        Get an XDM Item holding the contents of this resource.
        Specified by:
        getItem in interface Resource
        Parameters:
        context - the XPath evaluation context
        Returns:
        an item holding the contents of the resource. The type of item will reflect the type of the resource: a document node for XML resources, a string for text resources, a map or array for JSON resources, a base64Binary value for binary resource. May also return null if the resource cannot be materialized and this is not to be treated as an error.