当前位置: 首页>>代码示例>>Java>>正文


Java JobOriginatingUserName类代码示例

本文整理汇总了Java中javax.print.attribute.standard.JobOriginatingUserName的典型用法代码示例。如果您正苦于以下问题:Java JobOriginatingUserName类的具体用法?Java JobOriginatingUserName怎么用?Java JobOriginatingUserName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JobOriginatingUserName类属于javax.print.attribute.standard包,在下文中一共展示了JobOriginatingUserName类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import javax.print.attribute.standard.JobOriginatingUserName; //导入依赖的package包/类
/**
 * Writes an attribute in TextSyntax into the stream.
 * <p>
 * By default attributes are qritten as TEXT_WITHOUT_LANGUAGE value-tag.
 * As some attributes in the JPS are TextSyntax attributes but actually
 * of NAME value-tag in IPP this method checks for these attributes and
 * writes them as NAME_WITHOUT_LANGUAGE value-tag into the stream.
 * </p>
 *
 * @param attribute the attribute
 * @param out the stream to write to
 * @throws IOException if thrown by the stream
 */
private void write(TextSyntax attribute) throws IOException
{
  // We only use *WithoutLanguage, correct according to spec.
  String name = ((Attribute) attribute).getName();

  if (attribute instanceof RequestingUserName
      || attribute instanceof JobName
      || attribute instanceof DocumentName
      || attribute instanceof JobOriginatingUserName)
    out.writeByte(IppValueTag.NAME_WITHOUT_LANGUAGE);
  else if (attribute instanceof DocumentFormat)
    out.writeByte(IppValueTag.MIME_MEDIA_TYPE);
  else
    out.writeByte(IppValueTag.TEXT_WITHOUT_LANGUAGE);

  out.writeShort(name.length());
  out.write(name.getBytes());
  out.writeShort(attribute.getValue().length());
  out.write(attribute.getValue().getBytes());
}
 
开发者ID:vilie,项目名称:javify,代码行数:34,代码来源:IppRequest.java

示例2: write

import javax.print.attribute.standard.JobOriginatingUserName; //导入依赖的package包/类
/**
 * Writes an attribute in TextSyntax into the stream.
 * <p>
 * By default attributes are qritten as TEXT_WITHOUT_LANGUAGE value-tag.
 * As some attributes in the JPS are TextSyntax attributes but actually
 * of NAME value-tag in IPP this method checks for these attributes and
 * writes them as NAME_WITHOUT_LANGUAGE value-tag into the stream.
 * </p>
 * 
 * @param attribute the attribute
 * @param out the stream to write to
 * @throws IOException if thrown by the stream
 */
private void write(TextSyntax attribute) throws IOException
{
  // We only use *WithoutLanguage, correct according to spec.
  String name = ((Attribute) attribute).getName();

  if (attribute instanceof RequestingUserName
      || attribute instanceof JobName
      || attribute instanceof DocumentName
      || attribute instanceof JobOriginatingUserName)
    out.writeByte(IppValueTag.NAME_WITHOUT_LANGUAGE);
  else if (attribute instanceof DocumentFormat)
    out.writeByte(IppValueTag.MIME_MEDIA_TYPE);
  else
    out.writeByte(IppValueTag.TEXT_WITHOUT_LANGUAGE);
  
  out.writeShort(name.length());
  out.write(name.getBytes());
  out.writeShort(attribute.getValue().length());
  out.write(attribute.getValue().getBytes());     
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:34,代码来源:IppRequest.java


注:本文中的javax.print.attribute.standard.JobOriginatingUserName类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。