Class PropertiesFileContentDescriber

java.lang.Object
com.iizigo.fileexts.PropertiesFileContentDescriber
All Implemented Interfaces:
org.eclipse.core.runtime.content.IContentDescriber
Direct Known Subclasses:
ContextMenuFileContentDescriber, FontFacesFileContentDescriber, PanelFileContentDescriber, StyleFileContentDescriber

public abstract class PropertiesFileContentDescriber extends 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
  • Constructor Summary

    Constructors
    Constructor
    Description
    The constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    describe(InputStream contents, org.eclipse.core.runtime.content.IContentDescription description)
    Tries to fill a description for the given contents.
    org.eclipse.core.runtime.QualifiedName[]
    Returns the properties supported by this describer.
    protected abstract String[]
    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 Details

    • PropertiesFileContentDescriber

      public PropertiesFileContentDescriber()
      The constructor.
  • Method Details

    • getTags

      protected abstract 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.
    • getSupportedOptions

      public org.eclipse.core.runtime.QualifiedName[] getSupportedOptions()
      Returns the properties supported by this describer.
      Specified by:
      getSupportedOptions in interface org.eclipse.core.runtime.content.IContentDescriber
      Returns:
      the supported properties
      See Also:
    • describe

      public int describe(InputStream contents, org.eclipse.core.runtime.content.IContentDescription description) throws 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:
      IOException - if an I/O error occurs
      See Also:
      • IContentDescription
      • IContentDescriber.VALID
      • IContentDescriber.INVALID
      • IContentDescriber.INDETERMINATE