Java XML QName createRootElement(T value, QName q_name, Class elementClass)

Here you can find the source of createRootElement(T value, QName q_name, Class elementClass)

Description

create Root Element

License

Apache License

Declaration

private static <T> JAXBElement<T> createRootElement(T value, QName q_name, Class<T> elementClass) 

Method Source Code

//package com.java2s;
/**// w  w w  .j  a  v a 2  s . co  m
 * Copyright 2013 SPeCS Research Group.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License. under the License.
 */

import javax.xml.bind.JAXBElement;

import javax.xml.namespace.QName;

public class Main {
    private static <T> JAXBElement<T> createRootElement(T value, QName q_name, Class<T> elementClass) {
        return new JAXBElement<>(q_name, elementClass, null, value);
    }
}

Related

  1. convertQNameToFullname(QName qn)
  2. convertToQName(String source, String nameSpaceuri)
  3. copyQName(QName inName)
  4. crackQName(String qName)
  5. createCollection(QName... qnames)
  6. extract(final List anyList, final Class classType, final QName eltName)
  7. findAllElements(Element root, QName name, boolean local)
  8. findElement(QName elementName, List content)
  9. findElementRecursive(Element element, QName elementQName)

  10. HOME | Copyright © www.java2s.com 2016