Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * This file is part of the DiffX library.
  *
  * For licensing information please see the file license.txt included in the release.
  * A copy of this licence can also be found at
  *   http://www.opensource.org/licenses/artistic-license-2.0.php
  */
 package com.topologi.diffx.xml.esc;

Factory for XML escape classes.

Author(s):
Christophe Lauret
Version:
7 March 2005
public final class XMLEscapeFactory {

  
Prevents creation of instances.
  private XMLEscapeFactory() {
  }

  
Returns an instance of a XML Escape based on the given encoding.

This method returns null if the encoding is not supported.

Parameters:
encoding The encoding for which an escape implementation is requested.
Returns:
A XMLEscape instance corresponding to the specified encoding or null.
  public static XMLEscape getInstance(String encoding) {
    if ("utf-8".equals(encoding)) return .;
    if ("UTF-8".equals(encoding)) return .;
    if ("ASCII".equals(encoding)) return .;
    else return null;
  }
New to GrepCode? Check out our FAQ X