Codota Logo
XMLEncoder.setPersistenceDelegate
Code IndexAdd Codota to your IDE (free)

How to use
setPersistenceDelegate
method
in
java.beans.XMLEncoder

Best Java code snippets using java.beans.XMLEncoder.setPersistenceDelegate (Showing top 20 results out of 315)

  • Common ways to obtain XMLEncoder
private void myMethod () {
XMLEncoder x =
  • Codota IconOutputStream out;new XMLEncoder(out)
  • Codota IconFile file;new XMLEncoder(new BufferedOutputStream(new FileOutputStream(file)))
  • Codota IconOutputStream out;new XMLEncoder(new BufferedOutputStream(out))
  • Smart code suggestions by Codota
}
origin: oracle/opengrok

XMLEncoder e = new XMLEncoder(new GZIPOutputStream(
  new BufferedOutputStream(out)))) {
e.setPersistenceDelegate(File.class,
    new FilePersistenceDelegate());
e.writeObject(history);
origin: com.facebook.presto.hive/hive-apache

public static void addHivePersistenceDelegates(XMLEncoder e)
{
 e.setPersistenceDelegate(PrimitiveTypeInfo.class,
   new PersistenceDelegate()
   {
    @Override
    protected Expression instantiate(Object oldInstance,
      Encoder out)
    {
     return new Expression(oldInstance,
       TypeInfoFactory.class, "getPrimitiveTypeInfo",
       new Object[]
       { ((PrimitiveTypeInfo) oldInstance)
         .getTypeName() });
    }
   });
}
origin: net.sf.squirrel-sql/squirrel-sql

  private XMLEncoder getXmlEncoder(String filename)
     throws FileNotFoundException {
   XMLEncoder result = null;
   BufferedOutputStream os = 
     new BufferedOutputStream(new FileOutputStream(filename));
   result = new XMLEncoder(os);
   result.setPersistenceDelegate(ArtifactAction.class, enumDelegate);
   return result;
  }
}
origin: org.ihtsdo/wb-api

protected XMLEncoder getEncoder(File changeset) throws FileNotFoundException {
  XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(new File(
    changeset.getParent(), changeset.getName() + outputSuffix))));
  encoder.setPersistenceDelegate(UUID.class, new java.beans.PersistenceDelegate() {
    protected Expression instantiate(Object oldInstance, Encoder out) {
      return new Expression(oldInstance, oldInstance.getClass(), "fromString",
        new Object[] { oldInstance.toString() });
    }
  });
  return encoder;
}
origin: realXuJiang/bigtable-sql

  private XMLEncoder getXmlEncoder(String filename)
     throws FileNotFoundException {
   XMLEncoder result = null;
   BufferedOutputStream os = 
     new BufferedOutputStream(new FileOutputStream(filename));
   result = new XMLEncoder(os);
   result.setPersistenceDelegate(ArtifactAction.class, enumDelegate);
   return result;
  }
}
origin: christian-schlichtherle/truelicense

  @Override
  XMLEncoder encoder(final OutputStream out) {
    final XMLEncoder enc = super.encoder(out);
    enc.setPersistenceDelegate(X500Principal.class, delegate);
    return enc;
  }
}
origin: com.facebook.presto.hive/hive-apache

public static void addEnumDelegates(XMLEncoder e)
{
 e.setPersistenceDelegate(Direction.class, new EnumDelegate());
}
origin: org.apache.hadoop.hive/hive-exec

/**
 * Serialize a single Task.
 */
public static void serializeTasks(Task<? extends Serializable> t, OutputStream out) {
 XMLEncoder e = new XMLEncoder(out);
 // workaround for java 1.5
 e.setPersistenceDelegate(ExpressionTypes.class, new EnumDelegate());
 e.setPersistenceDelegate(GroupByDesc.Mode.class, new EnumDelegate());
 e.setPersistenceDelegate(Operator.ProgressCounter.class, new EnumDelegate());
 e.writeObject(t);
 e.close();
}
origin: com.facebook.presto.hive/hive-apache

/**
 * Serialize the object. This helper function mainly makes sure that enums,
 * counters, etc are handled properly.
 */
private static void serializeObjectByJavaXML(Object plan, OutputStream out) {
 XMLEncoder e = new XMLEncoder(out);
 e.setExceptionListener(new ExceptionListener() {
  @Override
  public void exceptionThrown(Exception e) {
   LOG.warn(org.apache.hadoop.util.StringUtils.stringifyException(e));
   throw new RuntimeException("Cannot serialize object", e);
  }
 });
 // workaround for java 1.5
 e.setPersistenceDelegate(ExpressionTypes.class, new EnumDelegate());
 e.setPersistenceDelegate(GroupByDesc.Mode.class, new EnumDelegate());
 e.setPersistenceDelegate(java.sql.Date.class, new DatePersistenceDelegate());
 e.setPersistenceDelegate(Timestamp.class, new TimestampPersistenceDelegate());
 e.setPersistenceDelegate(org.datanucleus.store.types.backed.Map.class, new MapDelegate());
 e.setPersistenceDelegate(org.datanucleus.store.types.backed.List.class, new ListDelegate());
 e.setPersistenceDelegate(CommonToken.class, new CommonTokenDelegate());
 e.setPersistenceDelegate(Path.class, new PathDelegate());
 e.writeObject(plan);
 e.close();
}
origin: org.apache.hadoop.hive/hive-exec

/**
 * Serialize the mapredWork object to an output stream. DO NOT use this to write to standard
 * output since it closes the output stream. DO USE mapredWork.toXML() instead.
 */
public static void serializeMapRedWork(MapredWork w, OutputStream out) {
 XMLEncoder e = new XMLEncoder(out);
 // workaround for java 1.5
 e.setPersistenceDelegate(ExpressionTypes.class, new EnumDelegate());
 e.setPersistenceDelegate(GroupByDesc.Mode.class, new EnumDelegate());
 e.writeObject(w);
 e.close();
}
origin: org.apache.hadoop.hive/hive-exec

/**
 * Serialize the mapredLocalWork object to an output stream. DO NOT use this to write to standard
 * output since it closes the output stream. DO USE mapredWork.toXML() instead.
 */
public static void serializeMapRedLocalWork(MapredLocalWork w, OutputStream out) {
 XMLEncoder e = new XMLEncoder(out);
 // workaround for java 1.5
 e.setPersistenceDelegate(ExpressionTypes.class, new EnumDelegate());
 e.setPersistenceDelegate(GroupByDesc.Mode.class, new EnumDelegate());
 e.writeObject(w);
 e.close();
}
origin: org.apache.hadoop.hive/hive-exec

/**
 * Serialize the whole query plan.
 */
public static void serializeQueryPlan(QueryPlan plan, OutputStream out) {
 XMLEncoder e = new XMLEncoder(out);
 e.setExceptionListener(new ExceptionListener() {
  public void exceptionThrown(Exception e) {
   LOG.warn(org.apache.hadoop.util.StringUtils.stringifyException(e));
   throw new RuntimeException("Cannot serialize the query plan", e);
  }
 });
 // workaround for java 1.5
 e.setPersistenceDelegate(ExpressionTypes.class, new EnumDelegate());
 e.setPersistenceDelegate(GroupByDesc.Mode.class, new EnumDelegate());
 e.setPersistenceDelegate(Operator.ProgressCounter.class, new EnumDelegate());
 e.setPersistenceDelegate(org.datanucleus.sco.backed.Map.class, new MapDelegate());
 e.setPersistenceDelegate(org.datanucleus.sco.backed.List.class, new ListDelegate());
 e.writeObject(plan);
 e.close();
}
origin: org.swinglabs.swingx/swingx-beaninfo

e.setPersistenceDelegate(AbstractPainter.Interpolation.class, new TypeSafeEnumPersistenceDelegate());
e.setPersistenceDelegate(RectanglePainter.Style.class, new TypeSafeEnumPersistenceDelegate());
e.setPersistenceDelegate(AbstractLayoutPainter.HorizontalAlignment.class, new TypeSafeEnumPersistenceDelegate());
e.setPersistenceDelegate(AbstractLayoutPainter.VerticalAlignment.class, new TypeSafeEnumPersistenceDelegate());
e.setPersistenceDelegate(AbstractPainter.class, new AbstractPainterDelegate());
e.setPersistenceDelegate(ImagePainter.class, new ImagePainterDelegate());
e.setPersistenceDelegate(RenderingHints.class, new RenderingHintsDelegate());
e.setPersistenceDelegate(GradientPaint.class, new GradientPaintDelegate());
e.setPersistenceDelegate(Arc2D.Float.class, new Arc2DDelegate());
e.setPersistenceDelegate(Arc2D.Double.class, new Arc2DDelegate());
e.setPersistenceDelegate(CubicCurve2D.Float.class, new CubicCurve2DDelegate());
e.setPersistenceDelegate(CubicCurve2D.Double.class, new CubicCurve2DDelegate());
e.setPersistenceDelegate(Ellipse2D.Float.class, new Ellipse2DDelegate());
e.setPersistenceDelegate(Ellipse2D.Double.class, new Ellipse2DDelegate());
e.setPersistenceDelegate(Line2D.Float.class, new Line2DDelegate());
e.setPersistenceDelegate(Line2D.Double.class, new Line2DDelegate());
e.setPersistenceDelegate(Point2D.Float.class, new Point2DDelegate());
e.setPersistenceDelegate(Point2D.Double.class, new Point2DDelegate());
e.setPersistenceDelegate(QuadCurve2D.Float.class, new QuadCurve2DDelegate());
e.setPersistenceDelegate(QuadCurve2D.Double.class, new QuadCurve2DDelegate());
e.setPersistenceDelegate(Rectangle2D.Float.class, new Rectangle2DDelegate());
e.setPersistenceDelegate(Rectangle2D.Double.class, new Rectangle2DDelegate());
e.setPersistenceDelegate(RoundRectangle2D.Float.class, new RoundRectangle2DDelegate());
e.setPersistenceDelegate(RoundRectangle2D.Double.class, new RoundRectangle2DDelegate());
e.setPersistenceDelegate(Area.class, new AreaDelegate());
e.setPersistenceDelegate(GeneralPath.class, new GeneralPathDelegate());
e.setPersistenceDelegate(AffineTransform.class, new AffineTransformDelegate());
origin: jtrfp/terminal-recall

  e.printStackTrace();
}});
xmlEnc.setPersistenceDelegate(DefaultListModel.class,
  new DefaultPersistenceDelegate() {
  protected void initialize(Class clazz,
origin: org.nuiton.jaxx/jaxx-runtime

e.setPersistenceDelegate(Rectangle.class, new RectanglePD());
e.setExceptionListener(el);
e.writeObject(states);
origin: org.nuiton/nuiton-widgets

e.setPersistenceDelegate(Rectangle.class, new RectanglePD());
e.setExceptionListener(el);
e.writeObject(states);
origin: org.nuiton.jaxx/jaxx-runtime-swing-session

e.setPersistenceDelegate(Rectangle.class, new RectanglePD());
e.setExceptionListener(el);
e.writeObject(states);
origin: jtrfp/terminal-recall

  e.printStackTrace();
}});
xmlEnc.setPersistenceDelegate(DefaultListModel.class,
  new DefaultPersistenceDelegate() {
  protected void initialize(Class clazz,
origin: org.jdesktop.bsaf/bsaf

e = new XMLEncoder(bst);
if (!persistenceDelegatesInitialized) {
  e.setPersistenceDelegate(Rectangle.class, new RectanglePD());
  persistenceDelegatesInitialized = true;
origin: net.java.dev.appframework/appframework

e = new XMLEncoder(bst);
  if (!persistenceDelegatesInitialized) {
    e.setPersistenceDelegate(Rectangle.class, new RectanglePD());
    persistenceDelegatesInitialized = true;
java.beansXMLEncodersetPersistenceDelegate

Popular methods of XMLEncoder

  • <init>
  • writeObject
  • close
  • setExceptionListener
  • flush
  • getOwner
  • setOwner
  • getPersistenceDelegate

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now