Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.core.runtime.content
Class XMLContentDescriber

java.lang.Object
  extended by org.eclipse.core.internal.content.TextContentDescriber
      extended by 
org.eclipse.core.runtime.content.XMLContentDescriber
All Implemented Interfaces:
IContentDescriber, ITextContentDescriber
Direct Known Subclasses:
XMLRootElementContentDescriber, XMLRootElementContentDescriber2

public class XMLContentDescriber
extends org.eclipse.core.internal.content.TextContentDescriber
implements ITextContentDescriber

A content describer for XML files. This class provides basis for XML-based content describers.

The document is detected by the describer as VALID, if it contains an xml declaration with <?xml prefix and the encoding in the declaration is correct.

Below are sample declarations recognized by the describer as VALID
  • <?xml version="1.0"?>
  • <?xml version="1.0"
  • <?xml version="1.0" encoding="utf-16"?>
  • <?xml version="1.0" encoding="utf-16?>

Since:
org.eclipse.core.contenttype 3.4
See Also:
IContentDescriber, XMLRootElementContentDescriber2, "https://www.w3.org/TR/REC-xml *"
Restriction:
This class is not intended to be instantiated by clients. Clients should use it to provide their own XML-based describers that can be referenced by the "describer" configuration element in extensions to the org.eclipse.core.runtime.contentTypes extension point.

Field Summary
 
Fields inherited from interface org.eclipse.core.runtime.content. IContentDescriber
INDETERMINATE, INVALID, VALID
 
Constructor Summary
XMLContentDescriber ()
           
 
Method Summary
 int describe ( InputStream input, IContentDescription description)
          Tries to fill a description for the given contents.
 int describe ( Reader input, IContentDescription description)
          Tries to fill a description for the given contents.
  QualifiedName[] getSupportedOptions ()
          Returns the properties supported by this describer.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLContentDescriber

public XMLContentDescriber()
Method Detail

describe

public int describe(
InputStream input,
                    
IContentDescription description)
             throws 
IOException
Description copied from interface: IContentDescriber
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 IContentDescriber
Overrides:
describe in class org.eclipse.core.internal.content.TextContentDescriber
Parameters:
input - 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

describe

public int describe(
Reader input,
                    
IContentDescription description)
             throws 
IOException
Description copied from interface: ITextContentDescriber
Tries to fill a description for the given contents. Returns an int indicating whether the given stream of characters represents a valid sample for this describer's corresponding content type. If no content description is provided, this method should only perform content type validation.

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

Specified by:
describe in interface ITextContentDescriber
Overrides:
describe in class org.eclipse.core.internal.content.TextContentDescriber
Parameters:
input - 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

getSupportedOptions

public 
QualifiedName[] getSupportedOptions()
Description copied from interface: IContentDescriber
Returns the properties supported by this describer.

Specified by:
getSupportedOptions in interface IContentDescriber
Overrides:
getSupportedOptions in class org.eclipse.core.internal.content.TextContentDescriber
Returns:
the supported properties
See Also:
IContentDescriber.describe(java.io.InputStream, org.eclipse.core.runtime.content.IContentDescription)

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire