congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
XMLEncoder.setPersistenceDelegate
Code IndexAdd Tabnine 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)

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

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JFileChooser (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now