Class PropertiesFileContentDescriber

  • All Implemented Interfaces:
    org.eclipse.core.runtime.content.IContentDescriber
    Direct Known Subclasses:
    ContextMenuFileContentDescriber, FontFacesFileContentDescriber, PanelFileContentDescriber, StyleFileContentDescriber

    public abstract class PropertiesFileContentDescriber
    extends java.lang.Object
    implements org.eclipse.core.runtime.content.IContentDescriber
    The content describer for the property files. The properties file must have the following format and cannot a contain comment text before the first line:
     [?xml version="1.0" encoding="UTF-8" standalone="no"?]
     [UIPanel name="customers"]
     
    Author:
    Christopher Mindus
    • Field Summary

      • Fields inherited from interface org.eclipse.core.runtime.content.IContentDescriber

        INDETERMINATE, INVALID, VALID
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethodDescription
      intdescribe​(java.io.InputStream contents, org.eclipse.core.runtime.content.IContentDescription description)
      Tries to fill a description for the given contents.
      org.eclipse.core.runtime.QualifiedName[]getSupportedOptions()
      Returns the properties supported by this describer.
      protected abstract java.lang.String[]getTags()
      Gets the list of tags names that is the content can process.
      • Methods inherited from class java.lang.Object

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

      • PropertiesFileContentDescriber

        public PropertiesFileContentDescriber()
        The constructor.
    • Method Detail

      • getTags

        protected abstract java.lang.String[] getTags()
        Gets the list of tags names that is the content can process. See the file "com.iizix.schema.base-properties.xml" for the tag names.
        Returns:
        The array of supported tags.
      • describe

        public int describe​(java.io.InputStream contents,
                            org.eclipse.core.runtime.content.IContentDescription description)
                     throws java.io.IOException
        Tries to fill a description for the given contents. Returns an int indicating whether the given stream of bytes represents a valid sample for its corresponding content type. If no content description is provided, this method should perform content type validation.

        The input stream must be kept open, and any IOExceptions while reading the stream should flow to the caller.

        Specified by:
        describe in interface org.eclipse.core.runtime.content.IContentDescriber
        Parameters:
        contents - the contents to be examined
        description - a description to be filled in, or null if only content type validation is to be performed
        Returns:
        one of the following:
        • VALID,
        • INVALID,
        • INDETERMINATE
        Throws:
        java.io.IOException - if an I/O error occurs
        See Also:
        IContentDescription, IContentDescriber.VALID, IContentDescriber.INVALID, IContentDescriber.INDETERMINATE