Java XML Element Get Value getXmlElementDecl(Method method)

Here you can find the source of getXmlElementDecl(Method method)

Description

Returns annotation XmlElementDecl of the given factory method

License

Open Source License

Parameter

Parameter Description
method a parameter

Exception

Parameter Description
Exception an exception

Return

XmlElementDecl

Declaration

public static XmlElementDecl getXmlElementDecl(Method method) throws Exception 

Method Source Code

//package com.java2s;
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

import java.lang.reflect.Method;

import javax.xml.bind.annotation.XmlElementDecl;

public class Main {
    /** Returns annotation XmlElementDecl of the given factory method 
     * //from   w w w  .j a va2  s  . c  om
     * @param method
     * @return XmlElementDecl
     * @throws Exception
     */
    public static XmlElementDecl getXmlElementDecl(Method method) throws Exception {
        XmlElementDecl ret = null;

        if (null == method) {
            throw new Exception("method is null");
        }

        XmlElementDecl xmlElementDecl = (XmlElementDecl) method.getAnnotation(XmlElementDecl.class);
        if (null != xmlElementDecl) {
            ret = xmlElementDecl;
        }

        return ret;
    }
}

Related

  1. getValueFromElement(Element element, String tagName)
  2. getWholeText(Element element)
  3. getXmlBoolean(Element element, String name)
  4. getXMLContent(XMLEventReader reader, StartElement element, boolean decodeCharacters)
  5. getXmlElementAnnotation(Field field)
  6. getXMLElementTextValue(Element element, String tagName)
  7. getXMLIdentifier(Element element)
  8. getXMLText(Element element)