gpt4 book ai didi

org.apache.knox.gateway.util.XmlUtils.getTransformer()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 07:00:40 26 4
gpt4 key购买 nike

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

XmlUtils.getTransformer介绍

暂无

代码示例

代码示例来源:origin: org.apache.knox/gateway-provider-rewrite

private static final void writeBufferedElement( Node node, Writer writer ) throws IOException {
 try {
  Transformer t = XmlUtils.getTransformer( false, false, 0, true );
  t.transform( new DOMSource( node ), new StreamResult( writer ) );
 } catch( TransformerException e ) {
  throw new IOException( e );
 }
}

代码示例来源:origin: apache/knox

private static void writeBufferedElement( Node node, Writer writer ) throws IOException {
  try {
   Transformer t = XmlUtils.getTransformer( false, false, 0, true );
   t.transform( new DOMSource( node ), new StreamResult( writer ) );
  } catch( TransformerException e ) {
   throw new IOException( e );
  }
 }
}

代码示例来源:origin: apache/knox

public static void writeXml( Document document, Writer writer ) throws TransformerException {
 Transformer t = XmlUtils.getTransformer( false, true, 4, false );
 writeXml( document, writer, t );
}

代码示例来源:origin: org.apache.knox/gateway-util-common

public static void writeXml( Document document, Writer writer ) throws TransformerException {
 Transformer t = XmlUtils.getTransformer( false, true, 4, false );
 writeXml( document, writer, t );
}

代码示例来源:origin: apache/knox

Transformer t = XmlUtils.getTransformer( true, false, 0, false );
XmlUtils.writeXml( document, writer, t );

代码示例来源:origin: apache/knox

@Override
 public Response call() throws Exception {
  Document document = XmlUtils.createDocument();
  Element root = document.createElement( ELEMENT_CELL_SET );
  document.appendChild( root );
  Element row = document.createElement( ELEMENT_ROW );
  row.setAttribute( ATTRIBUTE_KEY, Base64.encodeBase64String( rowId.getBytes( StandardCharsets.UTF_8 ) ) );
  root.appendChild( row );
  for( InsertableColumn column : columns ) {
   Element cell = document.createElement( ELEMENT_CELL );
   cell.setAttribute( ATTRIBUTE_COLUMN, column.encodedName() );
   if( column.time() != null ) {
    cell.setAttribute( ATTRIBUTE_TIMESTAMP, column.time().toString() );
   }
   cell.setTextContent( column.encodedValue() );
   row.appendChild( cell );
  }
  StringWriter writer = new StringWriter();
  Transformer t = XmlUtils.getTransformer( true, false, 0, false );
  XmlUtils.writeXml( document, writer, t );
  URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/false-row-key" );
  HttpPost request = new HttpPost( uri.build() );
  HttpEntity entity = new StringEntity( writer.toString(), ContentType.create( "text/xml", StandardCharsets.UTF_8 ) );
  request.setEntity( entity );
  return new Response( execute( request ) );
 }
};

代码示例来源:origin: org.apache.knox/gateway-shell

Transformer t = XmlUtils.getTransformer( true, false, 0, false );
XmlUtils.writeXml( document, writer, t );

代码示例来源:origin: org.apache.knox/gateway-shell

@Override
 public Response call() throws Exception {
  Document document = XmlUtils.createDocument();
  Element root = document.createElement( ELEMENT_CELL_SET );
  document.appendChild( root );
  Element row = document.createElement( ELEMENT_ROW );
  row.setAttribute( ATTRIBUTE_KEY, Base64.encodeBase64String( rowId.getBytes( StandardCharsets.UTF_8 ) ) );
  root.appendChild( row );
  for( InsertableColumn column : columns ) {
   Element cell = document.createElement( ELEMENT_CELL );
   cell.setAttribute( ATTRIBUTE_COLUMN, column.encodedName() );
   if( column.time() != null ) {
    cell.setAttribute( ATTRIBUTE_TIMESTAMP, column.time().toString() );
   }
   cell.setTextContent( column.encodedValue() );
   row.appendChild( cell );
  }
  StringWriter writer = new StringWriter();
  Transformer t = XmlUtils.getTransformer( true, false, 0, false );
  XmlUtils.writeXml( document, writer, t );
  URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/false-row-key" );
  HttpPost request = new HttpPost( uri.build() );
  HttpEntity entity = new StringEntity( writer.toString(), ContentType.create( "text/xml", StandardCharsets.UTF_8 ) );
  request.setEntity( entity );
  return new Response( execute( request ) );
 }
};

代码示例来源:origin: org.apache.knox/gateway-shell

@Override
 public Response call() throws Exception {
  Document document = XmlUtils.createDocument();
  Element root = document.createElement( ELEMENT_TABLE_SCHEMA );
  document.appendChild( root );
  for( Family<Request> family : families ) {
   Element columnSchema = document.createElement( ELEMENT_COLUMN_SCHEMA );
   columnSchema.setAttribute( ATTRIBUTE_NAME, family.name() );
   for( Attribute attribute : family.attributes() ) {
    columnSchema.setAttribute( attribute.getName(), attribute.getValue().toString() );
   }
   root.appendChild( columnSchema );
  }
  StringWriter writer = new StringWriter();
  Transformer t = XmlUtils.getTransformer( true, false, 0, false );
  XmlUtils.writeXml( document, writer, t );
  URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/schema" );
  HttpPost request = new HttpPost( uri.build() );
  HttpEntity entity = new StringEntity( writer.toString(), ContentType.create( "text/xml", StandardCharsets.UTF_8 ) );
  request.setEntity( entity );
  return new Response( execute( request ) );
 }
};

代码示例来源:origin: apache/knox

@Override
 public Response call() throws Exception {
  Document document = XmlUtils.createDocument();
  Element root = document.createElement( ELEMENT_TABLE_SCHEMA );
  document.appendChild( root );
  for( Family<Request> family : families ) {
   Element columnSchema = document.createElement( ELEMENT_COLUMN_SCHEMA );
   columnSchema.setAttribute( ATTRIBUTE_NAME, family.name() );
   for( Attribute attribute : family.attributes() ) {
    columnSchema.setAttribute( attribute.getName(), attribute.getValue().toString() );
   }
   root.appendChild( columnSchema );
  }
  StringWriter writer = new StringWriter();
  Transformer t = XmlUtils.getTransformer( true, false, 0, false );
  XmlUtils.writeXml( document, writer, t );
  URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/schema" );
  HttpPost request = new HttpPost( uri.build() );
  HttpEntity entity = new StringEntity( writer.toString(), ContentType.create( "text/xml", StandardCharsets.UTF_8 ) );
  request.setEntity( entity );
  return new Response( execute( request ) );
 }
};

代码示例来源:origin: org.apache.knox/gateway-shell

@Override
 public Response call() throws Exception {
  Document document = XmlUtils.createDocument();
  Element root = document.createElement( ELEMENT_TABLE_SCHEMA );
  root.setAttribute( ATTRIBUTE_NAME, tableName );
  for( Attribute attribute : attributes ) {
   root.setAttribute( attribute.getName(), attribute.getValue().toString() );
  }
  document.appendChild( root );
  for( Family<Request> family : families ) {
   Element columnSchema = document.createElement( ELEMENT_COLUMN_SCHEMA );
   columnSchema.setAttribute( ATTRIBUTE_NAME, family.name() );
   for( Attribute attribute : family.attributes() ) {
    columnSchema.setAttribute( attribute.getName(), attribute.getValue().toString() );
   }
   root.appendChild( columnSchema );
  }
  StringWriter writer = new StringWriter();
  Transformer t = XmlUtils.getTransformer( true, false, 0, false );
  XmlUtils.writeXml( document, writer, t );
  URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/schema" );
  HttpPut request = new HttpPut( uri.build() );
  HttpEntity entity = new StringEntity( writer.toString(), ContentType.create( "text/xml", StandardCharsets.UTF_8 ) );
  request.setEntity( entity );
  return new Response( execute( request ) );
 }
};

代码示例来源:origin: apache/knox

@Override
 public Response call() throws Exception {
  Document document = XmlUtils.createDocument();
  Element root = document.createElement( ELEMENT_TABLE_SCHEMA );
  root.setAttribute( ATTRIBUTE_NAME, tableName );
  for( Attribute attribute : attributes ) {
   root.setAttribute( attribute.getName(), attribute.getValue().toString() );
  }
  document.appendChild( root );
  for( Family<Request> family : families ) {
   Element columnSchema = document.createElement( ELEMENT_COLUMN_SCHEMA );
   columnSchema.setAttribute( ATTRIBUTE_NAME, family.name() );
   for( Attribute attribute : family.attributes() ) {
    columnSchema.setAttribute( attribute.getName(), attribute.getValue().toString() );
   }
   root.appendChild( columnSchema );
  }
  StringWriter writer = new StringWriter();
  Transformer t = XmlUtils.getTransformer( true, false, 0, false );
  XmlUtils.writeXml( document, writer, t );
  URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/schema" );
  HttpPut request = new HttpPut( uri.build() );
  HttpEntity entity = new StringEntity( writer.toString(), ContentType.create( "text/xml", StandardCharsets.UTF_8 ) );
  request.setEntity( entity );
  return new Response( execute( request ) );
 }
};

代码示例来源:origin: apache/knox

Transformer t = XmlUtils.getTransformer( true, true, 2, false );
  XmlUtils.writeXml( document, writer, t );
} catch (ParserConfigurationException | TransformerException e) {

代码示例来源:origin: org.apache.knox/gateway-provider-ha

Transformer t = XmlUtils.getTransformer( true, true, 2, false );
  XmlUtils.writeXml( document, writer, t );
} catch (ParserConfigurationException e) {

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