gpt4 book ai didi

org.restlet.representation.WriterRepresentation类的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 15:17:05 28 4
gpt4 key购买 nike

本文整理了Java中org.restlet.representation.WriterRepresentation类的一些代码示例,展示了WriterRepresentation类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriterRepresentation类的具体详情如下:
包路径:org.restlet.representation.WriterRepresentation
类名称:WriterRepresentation

WriterRepresentation介绍

[英]Representation based on a BIO characters writer. This class is a good basis to write your own representations, especially for the dynamic and large ones.

For this you just need to create a subclass and override the abstract Representation.write(Writer) method. This method will later be called back by the connectors when the actual representation's content is needed.
[中]基于生物特征作者的表现。本课程是编写自己的表达的良好基础,尤其是对于动态和大型表达。
为此,您只需要创建一个子类并重写抽象表示。write(Writer)方法。当需要实际表示的内容时,连接器稍后会调用此方法。

代码示例

代码示例来源:origin: org.restlet.jee/org.restlet.ext.xml

/**
 * Releases the namespaces map.
 */
@Override
public void release() {
  if (this.namespaces != null) {
    this.namespaces.clear();
    this.namespaces = null;
  }
  super.release();
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Constructor.
 * 
 * @param mediaType
 *            The representation's mediaType.
 * @param expectedSize
 *            The expected writer size in bytes.
 */
public WriterRepresentation(MediaType mediaType, long expectedSize) {
  super(mediaType);
  setSize(expectedSize);
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

@Override
public long getSize() {
  if (this.jsonRepresentation != null) {
    return this.jsonRepresentation.getSize();
  }
  return super.getSize();
}

代码示例来源:origin: org.restlet.osgi/org.restlet

public void run() {
    try {
      representation.write(pipedWriter);
      pipedWriter.flush();
    } catch (IOException ioe) {
      Context.getCurrentLogger().log(Level.WARNING,
          "Error while writing to the piped reader.", ioe);
    } finally {
      try {
        pipedWriter.close();
      } catch (IOException ioe2) {
        Context.getCurrentLogger().log(Level.WARNING,
            "Error while closing the pipe.", ioe2);
      }
    }
  }
};

代码示例来源:origin: apache/attic-polygene-java

representation.setCharacterSet( CharacterSet.UTF_8 );

代码示例来源:origin: org.restlet.jee/org.restlet.ext.json

@Override
public long getSize() {
  if (this.jsonRepresentation != null) {
    return this.jsonRepresentation.getSize();
  }
  return super.getSize();
}

代码示例来源:origin: org.restlet.jse/org.restlet.ext.json

@Override
public long getSize() {
  if (this.jsonRepresentation != null) {
    return this.jsonRepresentation.getSize();
  }
  return super.getSize();
}

代码示例来源:origin: org.restlet.android/org.restlet.ext.xml

/**
 * Releases the namespaces map.
 */
@Override
public void release() {
  if (this.namespaces != null) {
    this.namespaces.clear();
    this.namespaces = null;
  }
  super.release();
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * Constructor.
 * 
 * @param mediaType
 *            The representation's mediaType.
 * @param expectedSize
 *            The expected writer size in bytes.
 */
public WriterRepresentation(MediaType mediaType, long expectedSize) {
  super(mediaType);
  setSize(expectedSize);
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.xml

/**
 * Releases the source and transform sheet representations, the transformer
 * and the URI resolver.
 */
@Override
public void release() {
  if (this.sourceRepresentation != null) {
    this.sourceRepresentation.release();
    this.sourceRepresentation = null;
  }
  if (this.templates != null) {
    this.templates = null;
  }
  if (this.transformSheet != null) {
    this.transformSheet.release();
    this.transformSheet = null;
  }
  if (this.uriResolver != null) {
    this.uriResolver = null;
  }
  super.release();
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com