text:
/*
 * Created on :Jun 16, 2012 Author :songlin.li
 */
package cn.wuxia.common.util.reflection;

import cn.wuxia.common.util.*;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import jodd.bean.BeanCopy;
import jodd.typeconverter.TypeConverterManager;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;

import java.lang.reflect.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BeanUtil extends BeanUtils {
    private static Logger logger = LoggerFactory.getLogger(BeanUtil.class);

    static {

        ConvertUtil.registerUtilDateConverter();
        // ConvertUtil.registerDateConverter();
        ConvertUtil.registerSqlBlobConverter();
    }

    /**
     *

     * override
     * 本方法使用jodd beanutil 扩展支持时间,不同类型值的拷贝。
     *
     * 不建议使用{@link  org.apache.commons.beanutils.BeanUtils#copyProperties(Object, Object)}的复制方法
     *
     * 因为它支持的转换类型如下:

     * java.lang.BigDecimal

     * java.lang.BigInteger

     * boolean and java.lang.Boolean

     * byte and java.lang.Byte

     * char and java.lang.Character

     * java.lang.Class

     * double and java.lang.Double

     * float and java.lang.Float

     * int and java.lang.Integer

     * long and java.lang.Long

     * short and java.lang.Short

     * java.lang.String

     * java.sql.Date

     * java.sql.Time

     * java.sql.Timestamp

     * 这个方法的优点是同属性名不同对象的拷贝,缺点是资源和时间花费较多
     * {@link org.apache.commons.beanutils.PropertyUtils#copyProperties(Object, Object)}
     * 作用与 {@link  org.apache.commons.beanutils.BeanUtils#copyProperties(Object, Object)}的同名方法十分相似,
     * 主要的区别在于后者提供类型转换功能,即发现两个JavaBean的同名属性为不同类型时,在支持的数据类型范围内进行转换,
     * 而前者不支持这个功能,而且速度会更快一些。
     *
     * 另外:如没有特殊要求,简单bean复制可以使用spring下同名方法
     * {@link org.springframework.beans.BeanUtils#copyProperties(Object, Object)}建议在使用spring框架应用下使用
     *
     *
     *

     *
     * @param target
     * @param source
     * @author songlin.li
     */
    public static void copyProperties(Object target, Object source) {
        BeanCopy.beans(source, target).copy();
    }

    /**
     * @param dest
     * @param orig
     * @description : copy source filed value to target, when source filed value
     * is null then not convert target value
     * @author songlin.li
     */
    public static void copyPropertiesWithoutNullValues(Object dest, Object orig) {
        List<Field> methods = ReflectionUtil.getAccessibleFields(orig);
        for (Field field : methods) {
            if (Modifier.isStatic(field.getModifiers()) || Modifier.isFinal(field.getModifiers()))
                continue;
            String propertyName = field.getName();
            Object value = null;
            try {
                logger.debug(" try invokeGetterMethod property={}, property type={}", propertyName, field.getType().getName());
                value = ReflectionUtil.invokeGetterMethod(orig, propertyName);
            } catch (Exception e) {
                logger.warn(e.getMessage());
                try {
                    logger.debug(" try getFieldValue property={}, property type={}", propertyName, field.getType().getName());
                    value = ReflectionUtil.getFieldValue(orig, propertyName);
                } catch (Exception e1) {
                    logger.warn(e.getMessage());
                    try {
                        logger.debug(" try getProperty property={}, property type={}", propertyName, field.getType().getName());
                        value = BeanUtils.getProperty(orig, propertyName);
                    } catch (Exception e2) {
                        logger.warn(e.getMessage());
                    }
                }
            }
            if (value != null) {
                try {
                    logger.debug("try invokeSetterMethod property={}, value type = {}, property type={}", propertyName, value.getClass().getName(), field.getType().getName());
                    ReflectionUtil.invokeSetterMethod(dest, propertyName, value, field.getType());
                } catch (Exception e) {
                    logger.warn(e.getMessage());
                    try {
                        logger.debug("try setFieldValue property={}, value type = {}, property type={}", propertyName, value.getClass().getName(), field.getType().getName());
                        ReflectionUtil.setFieldValue(dest, propertyName, value);
                    } catch (Exception e1) {
                        logger.warn(e.getMessage());
                        try {
                            logger.debug("try setProperty property={}, value type = {}, property type={}", propertyName, value.getClass().getName(), field.getType().getName());
                            BeanUtils.setProperty(dest, propertyName, value);
                        } catch (Exception e2) {
                            logger.warn(e2.getMessage());
                        }
                    }
                }
            }
        }
    }

    public static <T> T mapToBean(Map<String, Object> map, Class<T> beanClass, String prefix) {
        if (beanClass == null) {
            return null;
        }
        Object bean = null;
        try {
            bean = beanClass.newInstance();
        } catch (IllegalAccessException e) {
            logger.error("", e);
        } catch (InstantiationException e) {
            logger.error("", e);
        }
        mapToBean(map, bean, prefix);
        return (T) bean;
    }

    /**
     * Description of the method
     *
     * @param map
     * @param bean
     * @param prefix
     * @author songlin.li
     */
    public static void mapToBean(Map<String, Object> map, Object bean, String prefix) {
        if (bean == null || map == null) {
            return;
        }

        for (Map.Entry<String, Object> m : map.entrySet()) {
            String fieldName = m.getKey();
            if (StringUtil.isNotBlank(prefix)) {
                if (fieldName.startsWith(prefix)) {
                    fieldName = StringUtil.substringAfter(fieldName, prefix);
                } else {
                    continue;
                }
            }
            try {
                /**
                 * FIXED 当value为数组时,只能获取第一个值
                 */
                if (m.getValue() instanceof String[] && bean instanceof Map) {
                    ((Map) bean).put(fieldName, m.getValue());
                } else {
                    BeanUtils.setProperty(bean, fieldName, m.getValue());
                }
            } catch (Exception e) {
                logger.error("", e);
            }

        }
    }

    /**
     * 将Map转换为目标对象,支持深度转换及List拷贝
     *
     * @param map
     * @param type
     * @return
     */
    public static final <T> T mapToBean(Map<String, ? extends Object> map, Class<T> type) {
        if (MapUtil.isEmpty(map)) {
            return null;
        }
        Object obj = null;
        try {
            obj = type.newInstance();
        } catch (InstantiationException e1) {
            logger.warn(e1.getMessage());
        } catch (IllegalAccessException e1) {
            logger.warn(e1.getMessage());
        }
        List<Field> fields = ReflectionUtil.getAccessibleFields(type);
        for (Field field : fields) {
            if (Modifier.isStatic(field.getModifiers()) || Modifier.isFinal(field.getModifiers()))
                continue;
            String propertyName = field.getName();
            Object value = map.get(propertyName);
            if (value == null)
                continue;
            Class<?> propertyType = field.getType();
            logger.debug("invoke {} set{}({} {}) and value is {} and type is {}", type.getName(), StringUtil.capitalize(propertyName),
                    propertyType.getName(), propertyName, value, value.getClass().getName());
            try {
                if (List.class.isAssignableFrom(propertyType)) {
                    Type genericType = field.getGenericType();
                    /**
                     * 拿到泛型的类型
                     */
                    Type genericValueType = ((ParameterizedType) genericType).getActualTypeArguments()[0];
                    String genericName = genericValueType.getTypeName();
                    Class<?> valueCls = null;
                    try {
                        valueCls = ClassLoaderUtil.loadClass(genericName);
                        logger.debug("泛型类型为<{}>", valueCls);
                        if (value instanceof List) {
                            value = ListUtil.copyProperties(valueCls, (List) value);
                        } else if (value instanceof Map) {
                            value = Lists.newArrayList(mapToBean((Map) value, valueCls));
                        } else {
                            Object v = valueCls.newInstance();
                            copyProperties(v, value);
                            value = Lists.newArrayList(v);
                        }
                    } catch (Exception e) {
                        logger.warn("泛型类型为<{}>", genericName);
                        value = TypeConverterManager.get().convertType(value, propertyType);
                    }
                } else if (Map.class.isAssignableFrom(propertyType)) {
                    // 如果还是一个Map,则尝试将map复制到obj的对象中
                    if (value instanceof Map) {

                    } else {
                        value = beanToMap(value);
                    }
                } else if (propertyType.isEnum()) {
                    try {
                        ReflectionUtil.invokeSetterMethod(obj, propertyName, value, value.getClass());
                    } catch (Exception e) {
                        logger.warn("暂不支持枚举转换,解决方法为:" + type.getName() + "请增加set" + StringUtil.capitalize(propertyName) + "("
                                + value.getClass().getName() + " " + propertyName + ") 方法");
                        try {
                            BeanUtils.setProperty(obj, propertyName, value);
                        } catch (Exception e1) {
                            logger.warn(e1.getMessage());
                        }
                    }
                    continue;
                } else if (StringUtil.equals(propertyType.getName(), "java.util.Date") && value instanceof String) {
                    value = DateUtil.stringToDate(value.toString());
                } /* else if (StringUtil.equals(propertyType.getName(), "java.lang.String") && !(value instanceof String)) {
                     value = value.toString();
                  } else if (StringUtil.equals(propertyType.getName(), "java.lang.Float") && !(value instanceof Float)) {
                     value = value.toString();
                  } else if (StringUtil.equals(propertyType.getName(), "java.lang.Integer") && !(value instanceof Integer)) {
                     value = NumberUtil.toInteger(value);
                  } else if (StringUtil.equals(propertyType.getName(), "java.lang.Double") && !(value instanceof Double)) {
                     value = NumberUtil.toDouble(value);
                  } else if (StringUtil.equals(propertyType.getName(), "java.lang.Short") && !(value instanceof Short)) {
                     value = NumberUtil.toShort(value.toString());
                  } else if (StringUtil.equals(propertyType.getName(), "java.lang.Long") && !(value instanceof Long)) {
                     value = NumberUtil.toLong(value);
                  }*/ else if (value instanceof Map) {
                    value = mapToBean((Map) value, propertyType);
                } else {
                    //                    value = ConvertUtil.convert(value, propertyType);
                    value = TypeConverterManager.get().convertType(value, propertyType);
                }
                if (value == null)
                    continue;
                /**
                 * value 不能为空
                 */

                try {
                    ReflectionUtil.invokeSetterMethod(obj, propertyName, value, propertyType);
                } catch (Exception e) {
                    logger.warn(e.getMessage());
                    logger.debug("try setFieldValue");
                    try {
                        ReflectionUtil.setFieldValue(obj, propertyName, value);
                    } catch (Exception e1) {
                        logger.warn(e1.getMessage());
                        logger.debug("try setProperty");
                        BeanUtils.setProperty(obj, propertyName, value);
                    }
                }
            } catch (Exception e) {
                String msg = e.getCause() != null ? e.getCause().getMessage() : e.getMessage();
                logger.warn("invoke fail : {} set{}({} {}) but value type is {}, error msg:", type.getName(), StringUtil.capitalize(propertyName),
                        propertyType.getName(), propertyName, value.getClass(), msg);
                continue;
            }
        }
        return (T) obj;

    }

    /**
     * Converts a JavaBean to a map.
     * 简单的转换,暂时没有对属性值为bean的转为
     *
     * @param bean JavaBean to convert
     * @return map converted
     */
    public static final Map<String, Object> beanToMap(Object bean) {
        Map<String, Object> returnMap = new HashMap<String, Object>();
        if (bean == null) {
            return returnMap;
        }

        List<Field> fields = ReflectionUtil.getAccessibleFields(bean);
        for (Field field : fields) {
            if (Modifier.isStatic(field.getModifiers()) || Modifier.isFinal(field.getModifiers()))
                continue;
            Object value = null;
            try {
                value = ReflectionUtil.invokeGetterMethod(bean, field.getName());
            } catch (Exception e) {
                logger.warn(e.getMessage());
                logger.debug("try getFieldValue");
                try {
                    value = ReflectionUtil.getFieldValue(bean, field.getName());
                } catch (Exception e2) {
                    logger.warn(e2.getMessage());
                    logger.debug("try getProperty");
                    try {
                        value = BeanUtils.getProperty(bean, field.getName());
                    } catch (Exception e4) {
                        logger.warn(e4.getMessage());
                    }
                    try {
                        Class fieldType = field.getType();
                        if (Boolean.class.isAssignableFrom(fieldType) && value == null) {
                            String getterMethodName = "is" + StringUtils.capitalize(field.getName());
                            value = ReflectionUtil.invokeMethod(bean, getterMethodName, new Class[]{}, new Object[]{});
                        }
                    } catch (Exception e3) {

                    }
                }
                logger.warn(e.getMessage());
            }
            if (value != null) {
                returnMap.put(field.getName(), value);
            }
        }
        return returnMap;
    }

    /**
     * 比较两个对象的属性值
     *
     * @param dest
     * @param org
     * @param ignore
     * @return
     * @throws SecurityException
     * @throws NoSuchMethodException
     * @throws IllegalAccessException
     * @throws InvocationTargetException
     * @author songlin
     */
    public static List<Map<String, Object>> compareProperties(Object dest, Object org, String... ignore)
            throws SecurityException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
        Assert.isNull(org, "对比原对象不能为空");
        Assert.isNull(dest, "对比目标对象不能为空");

        List<Map<String, Object>> list = Lists.newArrayList();
        Field[] fields = org.getClass().getDeclaredFields();
        BeanUtilsBean bean = BeanUtilsBean.getInstance();
        for (Field field : fields) {
            if (field.getName().equals("serialVersionUID"))
                continue;
            String propertyName = field.getName();
            /**
             * 忽略不需比较的属性
             */
            if (ArrayUtil.contains(ignore, propertyName)) {
                continue;
            }

            String type = field.getGenericType().toString(); // 获取属性的类型
            if (bean.getPropertyUtils().isWriteable(dest, propertyName)) {
                Object value = ReflectionUtil.invokeGetterMethod(org, propertyName);
                Object destValue = ReflectionUtil.invokeGetterMethod(dest, propertyName);
                if (value == null && destValue == null) {
                    continue;
                }

                Map<String, Object> rec = Maps.newHashMap();
                rec.put("fieldName", propertyName);
                if (type.equals("class java.lang.String")) { // 如果type是类类型,则前面包含"class
                    // ",后面跟类名

                    String _newV = (String) destValue;
                    String _orgV = (String) value;

                    String newValue = StringUtils.isBlank(_newV) ? "" : _newV.trim();
                    String originalValue = StringUtils.isBlank(_orgV) ? "" : _orgV.trim();
                    if ((StringUtils.isNotBlank(newValue) && !newValue.equals(originalValue))
                            || (StringUtils.isNotBlank(originalValue) && !originalValue.equals(newValue))) {
                        rec.put("newValue", newValue);
                        rec.put("originalValue", originalValue);
                        list.add(rec);
                    }
                }
                if (type.equals("class java.lang.Integer")) {
                    if (NumberUtil.compare((Integer) destValue, (Integer) value) != 0) {
                        rec.put("newValue", destValue);
                        rec.put("originalValue", value);
                        list.add(rec);
                    }
                }
                if (type.equals("class java.lang.Short")) {
                    if (NumberUtil.compare((Short) destValue, (Short) value) != 0) {
                        rec.put("newValue", destValue);
                        rec.put("originalValue", value);
                        list.add(rec);
                    }
                }
                if (type.equals("class java.lang.Double")) {
                    if (NumberUtil.compare((Double) destValue, (Double) value) != 0) {
                        rec.put("newValue", destValue);
                        rec.put("originalValue", value);
                        list.add(rec);
                    }
                }
                if (type.equals("class java.lang.Boolean")) {
                    if (!((Boolean) destValue).equals((Boolean) value)) {
                        rec.put("newValue", destValue);
                        rec.put("originalValue", value);
                        list.add(rec);
                    }
                }
                if (type.equals("class java.util.Date")) {
                    Date newValue = (Date) destValue;
                    Date originalValue = (Date) value;

                    if ((newValue != null && originalValue != null && !DateUtil.isSameDay(newValue, originalValue))) {
                        rec.put("newValue", newValue);
                        rec.put("originalValue", originalValue);
                        list.add(rec);
                    } else if ((newValue != null && originalValue == null)) {
                        rec.put("newValue", newValue);
                        rec.put("originalValue", null);
                        list.add(rec);
                    } else if ((newValue == null && originalValue != null)) {
                        rec.put("newValue", null);
                        rec.put("originalValue", originalValue);
                        list.add(rec);
                    }
                }
            }
        }
        return list;
    }

    public static void main(String[] args) throws Exception {
        CopyBean1 p1 = new CopyBean1();
        CopyBean2 p2 = new CopyBean2();
        //         p2.setTestDate(new Date());
        //         p2.setNumber(2);
        p1.setTestDate("2017-12-30");
        p1.setNumber("2");
        p2.setCopyEnum(CopyEnum.test2);
        // copyProperties(p2, p1);
        //        copyProperties(p1, p2);
        //        org.apache.commons.beanutils.PropertyUtils.copyProperties(p2, p1);
        //         org.springframework.beans.BeanUtils.copyProperties(p1, p2);
//        BeanCopy.beans(p1, p2).copy();
        copyPropertiesWithoutNullValues(p2, p1);
        System.out.println(p1.getTestDate());
        System.out.println(p2.getTestDate());
        System.out.println(p1.getNumber());
        System.out.println(p2.number);
        System.out.println(p1.getCopyEnum());
        System.out.println(p2.getCopyEnum());
//
//        System.out.println(HashMap.class.isAssignableFrom(Map.class));
//        System.out.println(Map.class.isAssignableFrom(HashMap.class));
//        List l = new ArrayList();
//        System.out.println(l.getClass().isAssignableFrom(List.class));
//        System.out.println(List.class.isAssignableFrom(l.getClass()));
//        System.out.println(List.class.isAssignableFrom(List.class));

        System.out.println(Boolean.class.isAssignableFrom(Boolean.class));
    }
}

enum CopyEnum {
    test1, test2;
}

class CopyBean1 {
    String testDate;

    String number;

    CopyEnum copyEnum;

    public String getTestDate() {
        return testDate;
    }

    public void setTestDate(String testDate) {
        this.testDate = testDate;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public CopyEnum getCopyEnum() {
        return copyEnum;
    }

    public void setCopyEnum(CopyEnum copyEnum) {
        this.copyEnum = copyEnum;
    }
}

class CopyBean2 {
    Date testDate;

    Integer number;

    CopyEnum copyEnum;

    public Date getTestDate() {
        return testDate;
    }

    public void setTestDate(Date testDate) {
        this.testDate = testDate;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public CopyEnum getCopyEnum() {
        return copyEnum;
    }

    public void setCopyEnum(CopyEnum copyEnum) {
        this.copyEnum = copyEnum;
    }
}


text:
//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert
// Siehe http://java.sun.com/xml/jaxb
// Änderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
// Generiert: 2016.09.10 um 03:05:14 AM CEST
//

package com.laegler.microservice.adapter.lib.webapp.v3_1;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;

/**
 * This object contains factory methods for each
 * Java content interface and Java element interface
 * generated in the com.laegler.microservice.adapter.lib.webapp.v3_1 package.
 *
An ObjectFactory allows you to programatically
 * construct new instances of the Java representation
 * for XML content. The Java representation of XML
 * content can consist of schema derived interfaces
 * and classes representing the binding of schema
 * type definitions, element declarations and model
 * groups.  Factory methods for each of these are
 * provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

    private final static QName _WebApp_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "web-app");
    private final static QName _WebAppTypeWelcomeFileList_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "welcome-file-list");
    private final static QName _WebAppTypeDenyUncoveredHttpMethods_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "deny-uncovered-http-methods");
    private final static QName _WebAppTypeEjbRef_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "ejb-ref");
    private final static QName _WebAppTypeResourceRef_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "resource-ref");
    private final static QName _WebAppTypeLoginConfig_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "login-config");
    private final static QName _WebAppTypeFilterMapping_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "filter-mapping");
    private final static QName _WebAppTypeSecurityConstraint_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "security-constraint");
    private final static QName _WebAppTypeDataSource_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "data-source");
    private final static QName _WebAppTypeMessageDestinationRef_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "message-destination-ref");
    private final static QName _WebAppTypePersistenceUnitRef_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "persistence-unit-ref");
    private final static QName _WebAppTypeJmsConnectionFactory_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "jms-connection-factory");
    private final static QName _WebAppTypeServletMapping_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "servlet-mapping");
    private final static QName _WebAppTypeMimeMapping_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "mime-mapping");
    private final static QName _WebAppTypeServlet_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "servlet");
    private final static QName _WebAppTypeServiceRef_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "service-ref");
    private final static QName _WebAppTypeLocaleEncodingMappingList_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "locale-encoding-mapping-list");
    private final static QName _WebAppTypeIcon_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "icon");
    private final static QName _WebAppTypeListener_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "listener");
    private final static QName _WebAppTypeMessageDestination_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "message-destination");
    private final static QName _WebAppTypeModuleName_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "module-name");
    private final static QName _WebAppTypeDescription_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "description");
    private final static QName _WebAppTypeAdministeredObject_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "administered-object");
    private final static QName _WebAppTypeEjbLocalRef_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "ejb-local-ref");
    private final static QName _WebAppTypeFilter_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "filter");
    private final static QName _WebAppTypeAbsoluteOrdering_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "absolute-ordering");
    private final static QName _WebAppTypeErrorPage_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "error-page");
    private final static QName _WebAppTypeJmsDestination_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "jms-destination");
    private final static QName _WebAppTypeDisplayName_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "display-name");
    private final static QName _WebAppTypePreDestroy_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "pre-destroy");
    private final static QName _WebAppTypeSessionConfig_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "session-config");
    private final static QName _WebAppTypeEnvEntry_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "env-entry");
    private final static QName _WebAppTypePersistenceContextRef_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "persistence-context-ref");
    private final static QName _WebAppTypeDistributable_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "distributable");
    private final static QName _WebAppTypePostConstruct_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "post-construct");
    private final static QName _WebAppTypeSecurityRole_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "security-role");
    private final static QName _WebAppTypeConnectionFactory_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "connection-factory");
    private final static QName _WebAppTypeJspConfig_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "jsp-config");
    private final static QName _WebAppTypeResourceEnvRef_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "resource-env-ref");
    private final static QName _WebAppTypeMailSession_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "mail-session");
    private final static QName _WebAppTypeContextParam_QNAME = new QName("http://xmlns.jcp.org/xml/ns/javaee", "context-param");

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.laegler.microservice.adapter.lib.webapp.v3_1
     *
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link WebAppType }
     *
     */
    public WebAppType createWebAppType() {
        return new WebAppType();
    }

    /**
     * Create an instance of {@link JspFileType }
     *
     */
    public JspFileType createJspFileType() {
        return new JspFileType();
    }

    /**
     * Create an instance of {@link TransportGuaranteeType }
     *
     */
    public TransportGuaranteeType createTransportGuaranteeType() {
        return new TransportGuaranteeType();
    }

    /**
     * Create an instance of {@link NonEmptyStringType }
     *
     */
    public NonEmptyStringType createNonEmptyStringType() {
        return new NonEmptyStringType();
    }

    /**
     * Create an instance of {@link WebResourceCollectionType }
     *
     */
    public WebResourceCollectionType createWebResourceCollectionType() {
        return new WebResourceCollectionType();
    }

    /**
     * Create an instance of {@link HandlerChainType }
     *
     */
    public HandlerChainType createHandlerChainType() {
        return new HandlerChainType();
    }

    /**
     * Create an instance of {@link InjectionTargetType }
     *
     */
    public InjectionTargetType createInjectionTargetType() {
        return new InjectionTargetType();
    }

    /**
     * Create an instance of {@link ResSharingScopeType }
     *
     */
    public ResSharingScopeType createResSharingScopeType() {
        return new ResSharingScopeType();
    }

    /**
     * Create an instance of {@link XsdStringType }
     *
     */
    public XsdStringType createXsdStringType() {
        return new XsdStringType();
    }

    /**
     * Create an instance of {@link AdministeredObjectType }
     *
     */
    public AdministeredObjectType createAdministeredObjectType() {
        return new AdministeredObjectType();
    }

    /**
     * Create an instance of {@link LifecycleCallbackType }
     *
     */
    public LifecycleCallbackType createLifecycleCallbackType() {
        return new LifecycleCallbackType();
    }

    /**
     * Create an instance of {@link AbsoluteOrderingType }
     *
     */
    public AbsoluteOrderingType createAbsoluteOrderingType() {
        return new AbsoluteOrderingType();
    }

    /**
     * Create an instance of {@link AuthConstraintType }
     *
     */
    public AuthConstraintType createAuthConstraintType() {
        return new AuthConstraintType();
    }

    /**
     * Create an instance of {@link CookieCommentType }
     *
     */
    public CookieCommentType createCookieCommentType() {
        return new CookieCommentType();
    }

    /**
     * Create an instance of {@link PortComponentRefType }
     *
     */
    public PortComponentRefType createPortComponentRefType() {
        return new PortComponentRefType();
    }

    /**
     * Create an instance of {@link ConnectionFactoryResourceType }
     *
     */
    public ConnectionFactoryResourceType createConnectionFactoryResourceType() {
        return new ConnectionFactoryResourceType();
    }

    /**
     * Create an instance of {@link MimeMappingType }
     *
     */
    public MimeMappingType createMimeMappingType() {
        return new MimeMappingType();
    }

    /**
     * Create an instance of {@link LocalHomeType }
     *
     */
    public LocalHomeType createLocalHomeType() {
        return new LocalHomeType();
    }

    /**
     * Create an instance of {@link SecurityConstraintType }
     *
     */
    public SecurityConstraintType createSecurityConstraintType() {
        return new SecurityConstraintType();
    }

    /**
     * Create an instance of {@link JspPropertyGroupType }
     *
     */
    public JspPropertyGroupType createJspPropertyGroupType() {
        return new JspPropertyGroupType();
    }

    /**
     * Create an instance of {@link AuthMethodType }
     *
     */
    public AuthMethodType createAuthMethodType() {
        return new AuthMethodType();
    }

    /**
     * Create an instance of {@link FilterMappingType }
     *
     */
    public FilterMappingType createFilterMappingType() {
        return new FilterMappingType();
    }

    /**
     * Create an instance of {@link EnvEntryType }
     *
     */
    public EnvEntryType createEnvEntryType() {
        return new EnvEntryType();
    }

    /**
     * Create an instance of {@link TaglibType }
     *
     */
    public TaglibType createTaglibType() {
        return new TaglibType();
    }

    /**
     * Create an instance of {@link JndiNameType }
     *
     */
    public JndiNameType createJndiNameType() {
        return new JndiNameType();
    }

    /**
     * Create an instance of {@link JavaIdentifierType }
     *
     */
    public JavaIdentifierType createJavaIdentifierType() {
        return new JavaIdentifierType();
    }

    /**
     * Create an instance of {@link XsdIntegerType }
     *
     */
    public XsdIntegerType createXsdIntegerType() {
        return new XsdIntegerType();
    }

    /**
     * Create an instance of {@link ResourceRefType }
     *
     */
    public ResourceRefType createResourceRefType() {
        return new ResourceRefType();
    }

    /**
     * Create an instance of {@link HandlerChainsType }
     *
     */
    public HandlerChainsType createHandlerChainsType() {
        return new HandlerChainsType();
    }

    /**
     * Create an instance of {@link ResAuthType }
     *
     */
    public ResAuthType createResAuthType() {
        return new ResAuthType();
    }

    /**
     * Create an instance of {@link CookieNameType }
     *
     */
    public CookieNameType createCookieNameType() {
        return new CookieNameType();
    }

    /**
     * Create an instance of {@link RunAsType }
     *
     */
    public RunAsType createRunAsType() {
        return new RunAsType();
    }

    /**
     * Create an instance of {@link MessageDestinationTypeType }
     *
     */
    public MessageDestinationTypeType createMessageDestinationTypeType() {
        return new MessageDestinationTypeType();
    }

    /**
     * Create an instance of {@link CookiePathType }
     *
     */
    public CookiePathType createCookiePathType() {
        return new CookiePathType();
    }

    /**
     * Create an instance of {@link LoginConfigType }
     *
     */
    public LoginConfigType createLoginConfigType() {
        return new LoginConfigType();
    }

    /**
     * Create an instance of {@link OrderingOthersType }
     *
     */
    public OrderingOthersType createOrderingOthersType() {
        return new OrderingOthersType();
    }

    /**
     * Create an instance of {@link ListenerType }
     *
     */
    public ListenerType createListenerType() {
        return new ListenerType();
    }

    /**
     * Create an instance of {@link RoleNameType }
     *
     */
    public RoleNameType createRoleNameType() {
        return new RoleNameType();
    }

    /**
     * Create an instance of {@link TransactionSupportType }
     *
     */
    public TransactionSupportType createTransactionSupportType() {
        return new TransactionSupportType();
    }

    /**
     * Create an instance of {@link GenericBooleanType }
     *
     */
    public GenericBooleanType createGenericBooleanType() {
        return new GenericBooleanType();
    }

    /**
     * Create an instance of {@link ResourceEnvRefType }
     *
     */
    public ResourceEnvRefType createResourceEnvRefType() {
        return new ResourceEnvRefType();
    }

    /**
     * Create an instance of {@link IconType }
     *
     */
    public IconType createIconType() {
        return new IconType();
    }

    /**
     * Create an instance of {@link EjbRefTypeType }
     *
     */
    public EjbRefTypeType createEjbRefTypeType() {
        return new EjbRefTypeType();
    }

    /**
     * Create an instance of {@link JavaTypeType }
     *
     */
    public JavaTypeType createJavaTypeType() {
        return new JavaTypeType();
    }

    /**
     * Create an instance of {@link AddressingResponsesType }
     *
     */
    public AddressingResponsesType createAddressingResponsesType() {
        return new AddressingResponsesType();
    }

    /**
     * Create an instance of {@link ParamValueType }
     *
     */
    public ParamValueType createParamValueType() {
        return new ParamValueType();
    }

    /**
     * Create an instance of {@link UserDataConstraintType }
     *
     */
    public UserDataConstraintType createUserDataConstraintType() {
        return new UserDataConstraintType();
    }

    /**
     * Create an instance of {@link EjbRefNameType }
     *
     */
    public EjbRefNameType createEjbRefNameType() {
        return new EjbRefNameType();
    }

    /**
     * Create an instance of {@link PathType }
     *
     */
    public PathType createPathType() {
        return new PathType();
    }

    /**
     * Create an instance of {@link LocalType }
     *
     */
    public LocalType createLocalType() {
        return new LocalType();
    }

    /**
     * Create an instance of {@link XsdNonNegativeIntegerType }
     *
     */
    public XsdNonNegativeIntegerType createXsdNonNegativeIntegerType() {
        return new XsdNonNegativeIntegerType();
    }

    /**
     * Create an instance of {@link XsdPositiveIntegerType }
     *
     */
    public XsdPositiveIntegerType createXsdPositiveIntegerType() {
        return new XsdPositiveIntegerType();
    }

    /**
     * Create an instance of {@link EnvEntryTypeValuesType }
     *
     */
    public EnvEntryTypeValuesType createEnvEntryTypeValuesType() {
        return new EnvEntryTypeValuesType();
    }

    /**
     * Create an instance of {@link XsdAnyURIType }
     *
     */
    public XsdAnyURIType createXsdAnyURIType() {
        return new XsdAnyURIType();
    }

    /**
     * Create an instance of {@link EmptyType }
     *
     */
    public EmptyType createEmptyType() {
        return new EmptyType();
    }

    /**
     * Create an instance of {@link LocaleEncodingMappingType }
     *
     */
    public LocaleEncodingMappingType createLocaleEncodingMappingType() {
        return new LocaleEncodingMappingType();
    }

    /**
     * Create an instance of {@link PersistenceContextTypeType }
     *
     */
    public PersistenceContextTypeType createPersistenceContextTypeType() {
        return new PersistenceContextTypeType();
    }

    /**
     * Create an instance of {@link SecurityRoleType }
     *
     */
    public SecurityRoleType createSecurityRoleType() {
        return new SecurityRoleType();
    }

    /**
     * Create an instance of {@link UrlPatternType }
     *
     */
    public UrlPatternType createUrlPatternType() {
        return new UrlPatternType();
    }

    /**
     * Create an instance of {@link AddressingType }
     *
     */
    public AddressingType createAddressingType() {
        return new AddressingType();
    }

    /**
     * Create an instance of {@link MessageDestinationType }
     *
     */
    public MessageDestinationType createMessageDestinationType() {
        return new MessageDestinationType();
    }

    /**
     * Create an instance of {@link EjbLocalRefType }
     *
     */
    public EjbLocalRefType createEjbLocalRefType() {
        return new EjbLocalRefType();
    }

    /**
     * Create an instance of {@link TrackingModeType }
     *
     */
    public TrackingModeType createTrackingModeType() {
        return new TrackingModeType();
    }

    /**
     * Create an instance of {@link CookieDomainType }
     *
     */
    public CookieDomainType createCookieDomainType() {
        return new CookieDomainType();
    }

    /**
     * Create an instance of {@link DescriptionType }
     *
     */
    public DescriptionType createDescriptionType() {
        return new DescriptionType();
    }

    /**
     * Create an instance of {@link PersistenceContextSynchronizationType }
     *
     */
    public PersistenceContextSynchronizationType createPersistenceContextSynchronizationType() {
        return new PersistenceContextSynchronizationType();
    }

    /**
     * Create an instance of {@link DataSourceType }
     *
     */
    public DataSourceType createDataSourceType() {
        return new DataSourceType();
    }

    /**
     * Create an instance of {@link ErrorPageType }
     *
     */
    public ErrorPageType createErrorPageType() {
        return new ErrorPageType();
    }

    /**
     * Create an instance of {@link ServletNameType }
     *
     */
    public ServletNameType createServletNameType() {
        return new ServletNameType();
    }

    /**
     * Create an instance of {@link JdbcUrlType }
     *
     */
    public JdbcUrlType createJdbcUrlType() {
        return new JdbcUrlType();
    }

    /**
     * Create an instance of {@link LocaleEncodingMappingListType }
     *
     */
    public LocaleEncodingMappingListType createLocaleEncodingMappingListType() {
        return new LocaleEncodingMappingListType();
    }

    /**
     * Create an instance of {@link MultipartConfigType }
     *
     */
    public MultipartConfigType createMultipartConfigType() {
        return new MultipartConfigType();
    }

    /**
     * Create an instance of {@link RespectBindingType }
     *
     */
    public RespectBindingType createRespectBindingType() {
        return new RespectBindingType();
    }

    /**
     * Create an instance of {@link JmsDestinationType }
     *
     */
    public JmsDestinationType createJmsDestinationType() {
        return new JmsDestinationType();
    }

    /**
     * Create an instance of {@link HandlerType }
     *
     */
    public HandlerType createHandlerType() {
        return new HandlerType();
    }

    /**
     * Create an instance of {@link TrueFalseType }
     *
     */
    public TrueFalseType createTrueFalseType() {
        return new TrueFalseType();
    }

    /**
     * Create an instance of {@link WelcomeFileListType }
     *
     */
    public WelcomeFileListType createWelcomeFileListType() {
        return new WelcomeFileListType();
    }

    /**
     * Create an instance of {@link MessageDestinationRefType }
     *
     */
    public MessageDestinationRefType createMessageDestinationRefType() {
        return new MessageDestinationRefType();
    }

    /**
     * Create an instance of {@link RemoteType }
     *
     */
    public RemoteType createRemoteType() {
        return new RemoteType();
    }

    /**
     * Create an instance of {@link MimeTypeType }
     *
     */
    public MimeTypeType createMimeTypeType() {
        return new MimeTypeType();
    }

    /**
     * Create an instance of {@link SessionConfigType }
     *
     */
    public SessionConfigType createSessionConfigType() {
        return new SessionConfigType();
    }

    /**
     * Create an instance of {@link XsdBooleanType }
     *
     */
    public XsdBooleanType createXsdBooleanType() {
        return new XsdBooleanType();
    }

    /**
     * Create an instance of {@link MailSessionType }
     *
     */
    public MailSessionType createMailSessionType() {
        return new MailSessionType();
    }

    /**
     * Create an instance of {@link JmsConnectionFactoryType }
     *
     */
    public JmsConnectionFactoryType createJmsConnectionFactoryType() {
        return new JmsConnectionFactoryType();
    }

    /**
     * Create an instance of {@link HomeType }
     *
     */
    public HomeType createHomeType() {
        return new HomeType();
    }

    /**
     * Create an instance of {@link FilterType }
     *
     */
    public FilterType createFilterType() {
        return new FilterType();
    }

    /**
     * Create an instance of {@link String }
     *
     */
    public String createString() {
        return new String();
    }

    /**
     * Create an instance of {@link XsdQNameType }
     *
     */
    public XsdQNameType createXsdQNameType() {
        return new XsdQNameType();
    }

    /**
     * Create an instance of {@link JspConfigType }
     *
     */
    public JspConfigType createJspConfigType() {
        return new JspConfigType();
    }

    /**
     * Create an instance of {@link FilterNameType }
     *
     */
    public FilterNameType createFilterNameType() {
        return new FilterNameType();
    }

    /**
     * Create an instance of {@link WarPathType }
     *
     */
    public WarPathType createWarPathType() {
        return new WarPathType();
    }

    /**
     * Create an instance of {@link PropertyType }
     *
     */
    public PropertyType createPropertyType() {
        return new PropertyType();
    }

    /**
     * Create an instance of {@link PersistenceContextRefType }
     *
     */
    public PersistenceContextRefType createPersistenceContextRefType() {
        return new PersistenceContextRefType();
    }

    /**
     * Create an instance of {@link FormLoginConfigType }
     *
     */
    public FormLoginConfigType createFormLoginConfigType() {
        return new FormLoginConfigType();
    }

    /**
     * Create an instance of {@link EjbLinkType }
     *
     */
    public EjbLinkType createEjbLinkType() {
        return new EjbLinkType();
    }

    /**
     * Create an instance of {@link SecurityRoleRefType }
     *
     */
    public SecurityRoleRefType createSecurityRoleRefType() {
        return new SecurityRoleRefType();
    }

    /**
     * Create an instance of {@link ServletType }
     *
     */
    public ServletType createServletType() {
        return new ServletType();
    }

    /**
     * Create an instance of {@link ServletMappingType }
     *
     */
    public ServletMappingType createServletMappingType() {
        return new ServletMappingType();
    }

    /**
     * Create an instance of {@link DisplayNameType }
     *
     */
    public DisplayNameType createDisplayNameType() {
        return new DisplayNameType();
    }

    /**
     * Create an instance of {@link MessageDestinationUsageType }
     *
     */
    public MessageDestinationUsageType createMessageDestinationUsageType() {
        return new MessageDestinationUsageType();
    }

    /**
     * Create an instance of {@link ServiceRefType }
     *
     */
    public ServiceRefType createServiceRefType() {
        return new ServiceRefType();
    }

    /**
     * Create an instance of {@link FullyQualifiedClassType }
     *
     */
    public FullyQualifiedClassType createFullyQualifiedClassType() {
        return new FullyQualifiedClassType();
    }

    /**
     * Create an instance of {@link EjbRefType }
     *
     */
    public EjbRefType createEjbRefType() {
        return new EjbRefType();
    }

    /**
     * Create an instance of {@link ErrorCodeType }
     *
     */
    public ErrorCodeType createErrorCodeType() {
        return new ErrorCodeType();
    }

    /**
     * Create an instance of {@link DispatcherType }
     *
     */
    public DispatcherType createDispatcherType() {
        return new DispatcherType();
    }

    /**
     * Create an instance of {@link CookieConfigType }
     *
     */
    public CookieConfigType createCookieConfigType() {
        return new CookieConfigType();
    }

    /**
     * Create an instance of {@link XsdNMTOKENType }
     *
     */
    public XsdNMTOKENType createXsdNMTOKENType() {
        return new XsdNMTOKENType();
    }

    /**
     * Create an instance of {@link MessageDestinationLinkType }
     *
     */
    public MessageDestinationLinkType createMessageDestinationLinkType() {
        return new MessageDestinationLinkType();
    }

    /**
     * Create an instance of {@link PersistenceUnitRefType }
     *
     */
    public PersistenceUnitRefType createPersistenceUnitRefType() {
        return new PersistenceUnitRefType();
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link WebAppType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "web-app")
    public JAXBElement<WebAppType> createWebApp(WebAppType value) {
        return new JAXBElement<WebAppType>(_WebApp_QNAME, WebAppType.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link WelcomeFileListType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "welcome-file-list", scope = WebAppType.class)
    public JAXBElement<WelcomeFileListType> createWebAppTypeWelcomeFileList(WelcomeFileListType value) {
        return new JAXBElement<WelcomeFileListType>(_WebAppTypeWelcomeFileList_QNAME, WelcomeFileListType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EmptyType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "deny-uncovered-http-methods", scope = WebAppType.class)
    public JAXBElement<EmptyType> createWebAppTypeDenyUncoveredHttpMethods(EmptyType value) {
        return new JAXBElement<EmptyType>(_WebAppTypeDenyUncoveredHttpMethods_QNAME, EmptyType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EjbRefType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "ejb-ref", scope = WebAppType.class)
    public JAXBElement<EjbRefType> createWebAppTypeEjbRef(EjbRefType value) {
        return new JAXBElement<EjbRefType>(_WebAppTypeEjbRef_QNAME, EjbRefType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link ResourceRefType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "resource-ref", scope = WebAppType.class)
    public JAXBElement<ResourceRefType> createWebAppTypeResourceRef(ResourceRefType value) {
        return new JAXBElement<ResourceRefType>(_WebAppTypeResourceRef_QNAME, ResourceRefType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LoginConfigType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "login-config", scope = WebAppType.class)
    public JAXBElement<LoginConfigType> createWebAppTypeLoginConfig(LoginConfigType value) {
        return new JAXBElement<LoginConfigType>(_WebAppTypeLoginConfig_QNAME, LoginConfigType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link FilterMappingType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "filter-mapping", scope = WebAppType.class)
    public JAXBElement<FilterMappingType> createWebAppTypeFilterMapping(FilterMappingType value) {
        return new JAXBElement<FilterMappingType>(_WebAppTypeFilterMapping_QNAME, FilterMappingType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link SecurityConstraintType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "security-constraint", scope = WebAppType.class)
    public JAXBElement<SecurityConstraintType> createWebAppTypeSecurityConstraint(SecurityConstraintType value) {
        return new JAXBElement<SecurityConstraintType>(_WebAppTypeSecurityConstraint_QNAME, SecurityConstraintType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link DataSourceType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "data-source", scope = WebAppType.class)
    public JAXBElement<DataSourceType> createWebAppTypeDataSource(DataSourceType value) {
        return new JAXBElement<DataSourceType>(_WebAppTypeDataSource_QNAME, DataSourceType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link MessageDestinationRefType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "message-destination-ref", scope = WebAppType.class)
    public JAXBElement<MessageDestinationRefType> createWebAppTypeMessageDestinationRef(MessageDestinationRefType value) {
        return new JAXBElement<MessageDestinationRefType>(_WebAppTypeMessageDestinationRef_QNAME, MessageDestinationRefType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link PersistenceUnitRefType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "persistence-unit-ref", scope = WebAppType.class)
    public JAXBElement<PersistenceUnitRefType> createWebAppTypePersistenceUnitRef(PersistenceUnitRefType value) {
        return new JAXBElement<PersistenceUnitRefType>(_WebAppTypePersistenceUnitRef_QNAME, PersistenceUnitRefType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link JmsConnectionFactoryType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "jms-connection-factory", scope = WebAppType.class)
    public JAXBElement<JmsConnectionFactoryType> createWebAppTypeJmsConnectionFactory(JmsConnectionFactoryType value) {
        return new JAXBElement<JmsConnectionFactoryType>(_WebAppTypeJmsConnectionFactory_QNAME, JmsConnectionFactoryType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link ServletMappingType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "servlet-mapping", scope = WebAppType.class)
    public JAXBElement<ServletMappingType> createWebAppTypeServletMapping(ServletMappingType value) {
        return new JAXBElement<ServletMappingType>(_WebAppTypeServletMapping_QNAME, ServletMappingType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link MimeMappingType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "mime-mapping", scope = WebAppType.class)
    public JAXBElement<MimeMappingType> createWebAppTypeMimeMapping(MimeMappingType value) {
        return new JAXBElement<MimeMappingType>(_WebAppTypeMimeMapping_QNAME, MimeMappingType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link ServletType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "servlet", scope = WebAppType.class)
    public JAXBElement<ServletType> createWebAppTypeServlet(ServletType value) {
        return new JAXBElement<ServletType>(_WebAppTypeServlet_QNAME, ServletType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link ServiceRefType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "service-ref", scope = WebAppType.class)
    public JAXBElement<ServiceRefType> createWebAppTypeServiceRef(ServiceRefType value) {
        return new JAXBElement<ServiceRefType>(_WebAppTypeServiceRef_QNAME, ServiceRefType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LocaleEncodingMappingListType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "locale-encoding-mapping-list", scope = WebAppType.class)
    public JAXBElement<LocaleEncodingMappingListType> createWebAppTypeLocaleEncodingMappingList(LocaleEncodingMappingListType value) {
        return new JAXBElement<LocaleEncodingMappingListType>(_WebAppTypeLocaleEncodingMappingList_QNAME, LocaleEncodingMappingListType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link IconType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "icon", scope = WebAppType.class)
    public JAXBElement<IconType> createWebAppTypeIcon(IconType value) {
        return new JAXBElement<IconType>(_WebAppTypeIcon_QNAME, IconType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link ListenerType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "listener", scope = WebAppType.class)
    public JAXBElement<ListenerType> createWebAppTypeListener(ListenerType value) {
        return new JAXBElement<ListenerType>(_WebAppTypeListener_QNAME, ListenerType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link MessageDestinationType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "message-destination", scope = WebAppType.class)
    public JAXBElement<MessageDestinationType> createWebAppTypeMessageDestination(MessageDestinationType value) {
        return new JAXBElement<MessageDestinationType>(_WebAppTypeMessageDestination_QNAME, MessageDestinationType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "module-name", scope = WebAppType.class)
    public JAXBElement<String> createWebAppTypeModuleName(String value) {
        return new JAXBElement<String>(_WebAppTypeModuleName_QNAME, String.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link DescriptionType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "description", scope = WebAppType.class)
    public JAXBElement<DescriptionType> createWebAppTypeDescription(DescriptionType value) {
        return new JAXBElement<DescriptionType>(_WebAppTypeDescription_QNAME, DescriptionType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link AdministeredObjectType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "administered-object", scope = WebAppType.class)
    public JAXBElement<AdministeredObjectType> createWebAppTypeAdministeredObject(AdministeredObjectType value) {
        return new JAXBElement<AdministeredObjectType>(_WebAppTypeAdministeredObject_QNAME, AdministeredObjectType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EjbLocalRefType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "ejb-local-ref", scope = WebAppType.class)
    public JAXBElement<EjbLocalRefType> createWebAppTypeEjbLocalRef(EjbLocalRefType value) {
        return new JAXBElement<EjbLocalRefType>(_WebAppTypeEjbLocalRef_QNAME, EjbLocalRefType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link FilterType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "filter", scope = WebAppType.class)
    public JAXBElement<FilterType> createWebAppTypeFilter(FilterType value) {
        return new JAXBElement<FilterType>(_WebAppTypeFilter_QNAME, FilterType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link AbsoluteOrderingType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "absolute-ordering", scope = WebAppType.class)
    public JAXBElement<AbsoluteOrderingType> createWebAppTypeAbsoluteOrdering(AbsoluteOrderingType value) {
        return new JAXBElement<AbsoluteOrderingType>(_WebAppTypeAbsoluteOrdering_QNAME, AbsoluteOrderingType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link ErrorPageType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "error-page", scope = WebAppType.class)
    public JAXBElement<ErrorPageType> createWebAppTypeErrorPage(ErrorPageType value) {
        return new JAXBElement<ErrorPageType>(_WebAppTypeErrorPage_QNAME, ErrorPageType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link JmsDestinationType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "jms-destination", scope = WebAppType.class)
    public JAXBElement<JmsDestinationType> createWebAppTypeJmsDestination(JmsDestinationType value) {
        return new JAXBElement<JmsDestinationType>(_WebAppTypeJmsDestination_QNAME, JmsDestinationType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link DisplayNameType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "display-name", scope = WebAppType.class)
    public JAXBElement<DisplayNameType> createWebAppTypeDisplayName(DisplayNameType value) {
        return new JAXBElement<DisplayNameType>(_WebAppTypeDisplayName_QNAME, DisplayNameType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LifecycleCallbackType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "pre-destroy", scope = WebAppType.class)
    public JAXBElement<LifecycleCallbackType> createWebAppTypePreDestroy(LifecycleCallbackType value) {
        return new JAXBElement<LifecycleCallbackType>(_WebAppTypePreDestroy_QNAME, LifecycleCallbackType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link SessionConfigType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "session-config", scope = WebAppType.class)
    public JAXBElement<SessionConfigType> createWebAppTypeSessionConfig(SessionConfigType value) {
        return new JAXBElement<SessionConfigType>(_WebAppTypeSessionConfig_QNAME, SessionConfigType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EnvEntryType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "env-entry", scope = WebAppType.class)
    public JAXBElement<EnvEntryType> createWebAppTypeEnvEntry(EnvEntryType value) {
        return new JAXBElement<EnvEntryType>(_WebAppTypeEnvEntry_QNAME, EnvEntryType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link PersistenceContextRefType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "persistence-context-ref", scope = WebAppType.class)
    public JAXBElement<PersistenceContextRefType> createWebAppTypePersistenceContextRef(PersistenceContextRefType value) {
        return new JAXBElement<PersistenceContextRefType>(_WebAppTypePersistenceContextRef_QNAME, PersistenceContextRefType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EmptyType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "distributable", scope = WebAppType.class)
    public JAXBElement<EmptyType> createWebAppTypeDistributable(EmptyType value) {
        return new JAXBElement<EmptyType>(_WebAppTypeDistributable_QNAME, EmptyType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link LifecycleCallbackType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "post-construct", scope = WebAppType.class)
    public JAXBElement<LifecycleCallbackType> createWebAppTypePostConstruct(LifecycleCallbackType value) {
        return new JAXBElement<LifecycleCallbackType>(_WebAppTypePostConstruct_QNAME, LifecycleCallbackType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link SecurityRoleType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "security-role", scope = WebAppType.class)
    public JAXBElement<SecurityRoleType> createWebAppTypeSecurityRole(SecurityRoleType value) {
        return new JAXBElement<SecurityRoleType>(_WebAppTypeSecurityRole_QNAME, SecurityRoleType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link ConnectionFactoryResourceType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "connection-factory", scope = WebAppType.class)
    public JAXBElement<ConnectionFactoryResourceType> createWebAppTypeConnectionFactory(ConnectionFactoryResourceType value) {
        return new JAXBElement<ConnectionFactoryResourceType>(_WebAppTypeConnectionFactory_QNAME, ConnectionFactoryResourceType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link JspConfigType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "jsp-config", scope = WebAppType.class)
    public JAXBElement<JspConfigType> createWebAppTypeJspConfig(JspConfigType value) {
        return new JAXBElement<JspConfigType>(_WebAppTypeJspConfig_QNAME, JspConfigType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link ResourceEnvRefType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "resource-env-ref", scope = WebAppType.class)
    public JAXBElement<ResourceEnvRefType> createWebAppTypeResourceEnvRef(ResourceEnvRefType value) {
        return new JAXBElement<ResourceEnvRefType>(_WebAppTypeResourceEnvRef_QNAME, ResourceEnvRefType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link MailSessionType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "mail-session", scope = WebAppType.class)
    public JAXBElement<MailSessionType> createWebAppTypeMailSession(MailSessionType value) {
        return new JAXBElement<MailSessionType>(_WebAppTypeMailSession_QNAME, MailSessionType.class, WebAppType.class, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link ParamValueType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "context-param", scope = WebAppType.class)
    public JAXBElement<ParamValueType> createWebAppTypeContextParam(ParamValueType value) {
        return new JAXBElement<ParamValueType>(_WebAppTypeContextParam_QNAME, ParamValueType.class, WebAppType.class, value);
    }

}

redpajama_set_name: RedPajamaGithub


text:
"use strict";

var _toolsProtectJs2 = require("./../../tools/protect.js");

var _toolsProtectJs3 = _interopRequireDefault(_toolsProtectJs2);

exports.__esModule = true;

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } }

var _types = require("../../types");

var t = _interopRequireWildcard(_types);

_toolsProtectJs3["default"](module);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

exports["default"] = function (decorators, scope) {
  for (var i = 0; i < decorators.length; i++) {
    var decorator = decorators[i];
    var expression = decorator.expression;
    if (!t.isMemberExpression(expression)) continue;

    var temp = scope.maybeGenerateMemoised(expression.object);
    var ref;

    var nodes = [];

    if (temp) {
      ref = temp;
      nodes.push(t.assignmentExpression("=", temp, expression.object));
    } else {
      ref = expression.object;
    }

    nodes.push(t.callExpression(t.memberExpression(t.memberExpression(ref, expression.property, expression.computed), t.identifier("bind")), [ref]));

    if (nodes.length === 1) {
      decorator.expression = nodes[0];
    } else {
      decorator.expression = t.sequenceExpression(nodes);
    }
  }

  return decorators;
};

module.exports = exports["default"];


text:
from Crypto.Signature import PKCS1_v1_5
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA

import base64

def verify(message, signature, public_key):
    """
    Verify whether the given signature of the message was produced using
    the private key paired with the given public key.

    :param message: A unicode string representing the message whose
        signature is being verified
    :param signature: The signature of the message represented as a base64
        encoded bytearray
    :param public_key: The public key to validate against, represented as
        a base64 encoded bytearray
    """
    if message is None:
        return False

    message = message.encode('utf-8')

    try:
        signature = base64.decodestring(signature)
        public_key = base64.decodestring(public_key)
    except:
        # If either the signature or the public key cannot be converted
        # to bytes (i.e. the base64 representation is invalid), indicate
        # that the verification failed
        return False
    try:
        public_key = RSA.importKey(public_key)
    except:
        # Invalid key => signature does not match it
        return False

    message_hash = SHA.new()
    message_hash.update(message)

    try:
        verifier = PKCS1_v1_5.new(public_key)
        return verifier.verify(message_hash, signature)
    except:
        # Error while verifying => invalid signature
        return False


text:
<?php
	include'lib/common.php';
	String::magicQuotesOff();
//print_ar($_REQUEST);
	$action = $_REQUEST['action'];
	if ($action == 'delete') {
		if (is_array($_REQUEST['rows'])) {
			foreach ($_REQUEST['rows'] as $table => $rows) {
				if (!$table || $table == 'undefined')
					continue;

				if (is_array($rows)) {
					$subtables = DB::getSubtables($table);

					foreach ($rows as $id) {
						if (is_array($_REQUEST['sub_records'])) {
							DB::deleteRecursive($table,$id);
						}
						elseif (!(db_delete($table,$id))) {
							$errors[] = $CFG->ajax_delete_error;
						}
						DB::deleteFiles($table.'_files',$id);
						DB::deleteCats($table,$id);
						if ($_REQUEST['delete_controls']) {
							$f_key = ($table == 'admin_tabs') ? 'tab_id' : 'page_id';
							$sql = "
							DELETE admin_controls.*,admin_controls_methods.*
							FROM admin_controls
							LEFT JOIN admin_controls_methods ON (admin_controls_methods.control_id = admin_controls.id)
							WHERE admin_controls.{$f_key} = $id";
							if (!db_query($sql)) {
								$errors[] = $CFG->ajax_delete_error;
							}
						}
					}
				}
			}
		}
		else {

			if (!(db_delete($_REQUEST['table'],$_REQUEST['id']))) {;
				$errors[] = $CFG->ajax_delete_error;
			}

			if (!empty($_REQUEST['subtable']) && $_REQUEST['subtable'] != 'false') {
				$f_id_field = (empty($_REQUEST['f_id_field'])) ? 'f_id' : $_REQUEST['f_id_field'];
				db_delete($_REQUEST['subtable'],$_REQUEST['id'],$f_id_field);
			}
			if (!empty($_REQUEST['filename'])) {
				$parts = pathinfo($_REQUEST['filename']);
				$name = $parts['filename'];
				$ext = $parts['extension'];

				File::deleteLike($name,$_REQUEST['dir']);
			}
		}
	}
	elseif ($action == 'set_active') {
		if (is_array($_REQUEST['rows'])) {
			foreach ($_REQUEST['rows'] as $table => $rows) {
				if (is_array($rows)) {
					$active = ($_REQUEST['active'] == 1) ? 'Y' : 'N';
					foreach ($rows as $id) {
						if (!(DB::update($table,array('is_active'=>$active),$id))) {
							$errors[] = $CFG->ajax_save_error;
						}
					}
				}
			}
		}
	}
	elseif ($action == 'delete_file') {
		if (!empty($_REQUEST['filename'])) {
			unlink($_REQUEST['filename']);
		}
	}
	elseif ($action == 'check_table') {
		if (!DB::tableExists($_REQUEST['table'])) {
			DB::createTable($_REQUEST['table'],$_REQUEST['db_fields'],$_REQUEST['radioinputs']);
		}
		else {
			DB::editTable($_REQUEST['table'],$_REQUEST['db_fields'],$_REQUEST['radioinputs']);
		}
	}
	elseif ($_REQUEST['rows'] && !empty($_REQUEST['rows'])) {
		foreach ($_REQUEST['rows'] as $row) {
			if ($row['info']) {
				if ($row['id']) {
					DB::update($row['table'],$row['info'],$row['id']);
				}
				else {
					DB::insert($row['table'],$row['info']);
				}
			}
		}
	}
	elseif ($_REQUEST['table']) {
		if ($row['id'])
			if (!(DB::update($_REQUEST['table'],$_REQUEST['info'],$_REQUEST['id']))) {
				$errors[] = $CFG->ajax_save_error;
			}
		else
			if (!(DB::insert($_REQUEST['table'],$_REQUEST['info']))) {
				$errors[] = $CFG->ajax_insert_error;
			}
	}
	elseif ($_REQUEST['delete']) {

	}

	if ($_REQUEST['l_order'] && is_array($_REQUEST['l_order'])) {
		foreach ($_REQUEST['l_order'] as $table => $items) {
			$table_fields = DB::getTableFields($table,true);
			if (!in_array('order',$table_fields))
				continue;

			$i = 0;
			foreach ($items as $order => $id) {
				if (in_array('page_map_reorders',$table_fields) && $table == 'admin_pages') {
					$rec = DB::getRecord('admin_pages',$id,0,1);
					if ($rec['page_map_reorders'] > 0)
						continue;
				}
				DB::update($table,array('order'=>$i),$id);
				$i++;
			}
		}
	}

	if (is_array($_REQUEST['page_map'])) {
		if (is_array($_REQUEST['page_map']['methods'])) {
			foreach ($_REQUEST['page_map']['methods'] as $order => $id) {
				DB::update('admin_controls_methods',array('order'=>$order),$id);
			}
		}
		if (is_array($_REQUEST['page_map']['pages'])) {
			foreach ($_REQUEST['page_map']['pages'] as $order => $id) {
				DB::update('admin_pages',array('order'=>$order,'page_map_reorders'=>1),$id);
			}
		}
	}

	if (!$errors) {
		Messages::add($CFG->ajax_save_message);
		Messages::display();
	}
	else {
		Errors::merge($errors);
		Errors::display();
	}

?>


text:
//
//  NSMutableDictionary+PXObject.m
//  Pixate
//
//  Modified by Anton Matosov on 12/30/15.
//  Created by Kevin Lindsey on 3/26/13.
//  Copyright (c) 2013 Pixate, Inc. All rights reserved.
//

#import "NSMutableDictionary+PXObject.h"
#import "PXValue.h"

void PXForceLoadNSMutableDictionaryPXObject() {}

@implementation NSMutableDictionary (PXObject)

- (void)setNilableObject:(id)object forKey:(id<NSCopying>)key
{
    id nilableObject = (object == nil) ? [NSNull null] : object;

    self[key] = nilableObject;
}

- (void)setRect:(CGRect)rect forKey:(id<NSCopying>)key
{
    PXValue *value = [[PXValue alloc] initWithBytes:&rect type:PXValueType_CGRect];

    self[key] = value;
}

- (void)setFloat:(CGFloat)floatValue forKey:(id<NSCopying>)key
{
    PXValue *value = [[PXValue alloc] initWithBytes:&floatValue type:PXValueType_CGFloat];

    self[key] = value;
}

- (void)setColorRef:(CGColorRef)colorRef forKey:(id<NSCopying>)key
{
    PXValue *value = [[PXValue alloc] initWithBytes:&colorRef type:PXValueType_CGColorRef];

    self[key] = value;
}

- (void)setSize:(CGSize)size forKey:(id<NSCopying>)key
{
    PXValue *value = [[PXValue alloc] initWithBytes:&size type:PXValueType_CGSize];

    self[key] = value;
}

- (void)setBoolean:(BOOL)booleanValue forKey:(id<NSCopying>)key
{
    PXValue *value = [[PXValue alloc] initWithBytes:&booleanValue type:PXValueType_Boolean];

    self[key] = value;
}

- (void)setTransform:(CGAffineTransform)transform forKey:(id<NSCopying>)key
{
    PXValue *value = [[PXValue alloc] initWithBytes:&transform type:PXValueType_CGAffineTransform];

    self[key] = value;
}

- (void)setInsets:(UIEdgeInsets)insets forKey:(id<NSCopying>)key
{
    PXValue *value = [[PXValue alloc] initWithBytes:&insets type:PXValueType_UIEdgeInsets];

    self[key] = value;
}

- (void)setLineBreakMode:(NSLineBreakMode)mode forKey:(id<NSCopying>)key
{
    PXValue *value = [[PXValue alloc] initWithBytes:&mode type:PXValueType_NSLineBreakMode];

    self[key] = value;
}

- (void)setTextAlignment:(NSTextAlignment)alignment forKey:(id<NSCopying>)key
{
    PXValue *value = [[PXValue alloc] initWithBytes:&alignment type:PXValueType_NSTextAlignment];

    self[key] = value;
}
@end


text:
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace PInvoke
{
    /// <content>
    /// Contains the <see cref="SymmetricKeyBlobTypes"/> nested type.
    /// </content>
    public partial class NCrypt
    {
        /// <summary>
        /// Identifies the blob types of symmetric keys.
        /// </summary>
        public class SymmetricKeyBlobTypes : BCrypt.SymmetricKeyBlobTypes
        {
            /// <summary>
            /// Initializes a new instance of the <see cref="SymmetricKeyBlobTypes"/> class.
            /// </summary>
            /// <remarks>
            /// Suppresses generation of a public default constructor.
            /// </remarks>
            protected SymmetricKeyBlobTypes()
            {
            }
        }
    }
}


text:
/**
 * @class Ext.chart.series.Pie
 * @extends Ext.chart.series.Polar
 *
 * Creates a Pie Chart. A Pie Chart is a useful visualization technique to display quantitative information for different
 * categories that also have a meaning as a whole.
 * As with all other series, the Pie Series must be appended in the *series* Chart array configuration. See the Chart
 * documentation for more information. A typical configuration object for the pie series could be:
 *
 *     @example
 *     Ext.create({
 *        xtype: 'polar',
 *        renderTo: document.body,
 *        width: 400,
 *        height: 400,
 *        theme: 'green',
 *        interactions: 'rotate',
 *        store: {
 *            fields: ['name', 'data1'],
 *            data: [{
 *                name: 'metric one',
 *                data1: 14
 *            }, {
 *                name: 'metric two',
 *                data1: 16
 *            }, {
 *                name: 'metric three',
 *                data1: 14
 *            }, {
 *                name: 'metric four',
 *                data1: 6
 *            }, {
 *                name: 'metric five',
 *                data1: 36
 *            }]
 *        },
 *        series: {
 *            type: 'pie',
 *            label: {
 *                field: 'name',
 *                display: 'rotate'
 *            },
 *            xField: 'data1',
 *            donut: 30
 *        }
 *     });
 *
 * In this configuration we set `pie` as the type for the series, set an object with specific style properties for highlighting options
 * (triggered when hovering elements). We also set true to `showInLegend` so all the pie slices can be represented by a legend item.
 * We set `data1` as the value of the field to determine the angle span for each pie slice. We also set a label configuration object
 * where we set the field name of the store field to be rendered as text for the label. The labels will also be displayed rotated.
 *
 */
Ext.define('Ext.chart.series.Pie', {
    extend: 'Ext.chart.series.Polar',
    requires: [
        'Ext.chart.series.sprite.PieSlice'
    ],
    type: 'pie',
    alias: 'series.pie',
    seriesType: 'pieslice',

    config: {
        /**
         * @cfg {String} labelField
         * @deprecated Use {@link Ext.chart.series.Pie#label} instead.
         * The store record field name to be used for the pie slice labels.
         */
        labelField: false,

        /**
         * @cfg {String} lengthField
         * The store record field name to be used for the pie slice lengths.
         * The values bound to this field name must be positive real numbers.
         */
        lengthField: false,

        /**
         * @cfg {Number} donut Specifies the radius of the donut hole, as a percentage of the chart's radius.
         * Defaults to 0 (no donut hole).
         */
        donut: 0,

        /**
         * @cfg {String} field
         * @deprecated Use xField directly
         */
        field: null,

        /**
         * @cfg {Number} rotation The starting angle of the pie slices.
         */
        rotation: 0,

        /**
         * @cfg {Boolean} clockwise
         * Whether the pie slices are displayed clockwise. Default's true.
         */
        clockwise: true,

        /**
         * @cfg {Number} [totalAngle=2*PI] The total angle of the pie series.
         */
        totalAngle: 2 * Math.PI,

        /**
         * @cfg {Array} hidden Determines which pie slices are hidden.
         */
        hidden: [],

        /**
         * @cfg {Number} [radiusFactor=100] Allows adjustment of the radius by a
         * specific percentage.
         */
        radiusFactor: 100,

        /**
         * @cfg {Ext.chart.series.sprite.PieSlice/Object} highlightCfg
         * Default highlight config for the pie series.
         * Slides highlighted pie sector outward by default.
         *
         * highlightCfg accepts as its value a config object (or array of configs) for a
         * {@link Ext.chart.series.sprite.PieSlice pie sprite}.
         *
         * **Note:** You must configure the
         * {@link Ext.chart.interactions.ItemHighlight itemhighlight}
         * {@link Ext.chart.AbstractChart#interactions interaction} in order to
         * apply highlighting to the series.
         *
         * Example config:
         *
         *     Ext.create('Ext.chart.PolarChart', {
         *         renderTo: document.body,
         *         width: 600,
         *         height: 400,
         *         interactions: 'itemhighlight',
         *         innerPadding: 5,
         *         store: {
         *             fields: ['name', 'data1'],
         *             data: [{
         *                 name: 'metric one',
         *                 data1: 10
         *             }, {
         *                 name: 'metric two',
         *                 data1: 7
         *             }, {
         *                 name: 'metric three',
         *                 data1: 5
         *             }]
         *         },
         *         series: {
         *             type: 'pie',
         *             label: {
         *                 field: 'name',
         *                 display: 'rotate'
         *             },
         *             xField: 'data1',
         *             donut: 30,
         *             highlightCfg: {
         *                 margin: 10,
         *                 fillOpacity: .7
         *             }
         *         }
         *     });
         */
        highlightCfg: {
            margin: 20
        },

        style: {}
    },

    directions: ['X'],

    setField: function (f) {
        return this.setXField(f);
    },

    getField: function () {
        return this.getXField();
    },

    applyLabel: function (newLabel, oldLabel) {
        if (Ext.isObject(newLabel) && !Ext.isString(newLabel.orientation)) {
            // Override default label orientation from '' to 'vertical'.
            Ext.apply(newLabel = Ext.Object.chain(newLabel), {orientation: 'vertical'});
        }
        return this.callParent([newLabel, oldLabel]);
    },

    updateLabelData: function () {
        var me = this,
            store = me.getStore(),
            items = store.getData().items,
            sprites = me.getSprites(),
            labelField = me.getLabel().getTemplate().getField(),
            hidden = me.getHidden(),
            i, ln, labels, sprite;
        if (sprites.length > 0 && labelField) {
            labels = [];
            for (i = 0, ln = items.length; i < ln; i++) {
                labels.push(items[i].get(labelField));
            }
            for (i = 0, ln = sprites.length; i < ln; i++) {
                sprite = sprites[i];
                sprite.setAttributes({label: labels[i]});
                sprite.putMarker('labels', {hidden: hidden[i]}, sprite.attr.attributeId);
            }
        }
    },

    coordinateX: function () {
        var me = this,
            store = me.getStore(),
            records = store.getData().items,
            recordCount = records.length,
            xField = me.getXField(),
            yField = me.getYField(),
            x, sumX = 0, unit,
            y, maxY = 0,
            hidden = me.getHidden(),
            summation = [], i,
            lastAngle = 0,
            totalAngle = me.getTotalAngle(),
            clockwise = me.getClockwise() ? 1 : -1,
            sprites = me.getSprites(),
            chart, sprite;

        if (!sprites) {
            return;
        }

        for (i = 0; i < recordCount; i++) {
            x = Math.abs(Number(records[i].get(xField))) || 0;
            y = yField && Math.abs(Number(records[i].get(yField))) || 0;
            if (!hidden[i]) {
                sumX += x;
                if (y > maxY) {
                    maxY = y;
                }
            }
            summation[i] = sumX;
            if (i >= hidden.length) {
                hidden[i] = false;
            }
        }
        hidden.length = recordCount;
        me.maxY = maxY;

        if (sumX !== 0) {
            unit = totalAngle / sumX;
        }
        for (i = 0; i < recordCount; i++) {
            sprites[i].setAttributes({
                startAngle: lastAngle,
                endAngle: lastAngle = (unit ? clockwise * summation[i] * unit : 0),
                globalAlpha: 1
            });
        }
        if (recordCount < me.sprites.length) {
            for (i = recordCount; i < me.sprites.length; i++) {
                sprite = me.sprites[i];
                // Don't want the 'labels' Markers and its 'template' sprite to be destroyed
                // with the PieSlice MarkerHolder, as it is also used by other pie slices.
                // So we release 'labels' before destroying the PieSlice.
                // But first, we have to clear the instances of the 'labels'
                // Markers created by the PieSlice MarkerHolder.
                sprite.getMarker('labels').clear(sprite.getId());
                sprite.releaseMarker('labels');
                sprite.destroy();
            }
            me.sprites.length = recordCount;
        }
        for (i = recordCount; i < me.sprites.length; i++) {
            sprites[i].setAttributes({
                startAngle: totalAngle,
                endAngle: totalAngle,
                globalAlpha: 0
            });
        }

        chart = me.getChart();
        // 'refreshLegendStore' will attemp to grab the 'series',
        // which are still configuring at this point.
        // The legend store will be refreshed inside the chart.series
        // updater anyway.
        if (!chart.isConfiguring) {
            chart.refreshLegendStore();
        }
    },

    updateCenter: function (center) {
        this.setStyle({
            translationX: center[0] + this.getOffsetX(),
            translationY: center[1] + this.getOffsetY()
        });
        this.doUpdateStyles();
    },

    updateRadius: function (radius) {
        this.setStyle({
            startRho: radius * this.getDonut() * 0.01,
            endRho: radius * this.getRadiusFactor() * 0.01
        });
        this.doUpdateStyles();
    },

    getStyleByIndex: function (i) {
        var me = this,
            store = me.getStore(),
            item = store.getAt(i),
            yField = me.getYField(),
            radius = me.getRadius(),
            style = {},
            startRho, endRho, y;

        if (item) {
            y = yField && Math.abs(Number(item.get(yField))) || 0;
            startRho = radius * me.getDonut() * 0.01;
            endRho = radius * me.getRadiusFactor() * 0.01;
            style = me.callParent([i]);
            style.startRho = startRho;
            style.endRho = me.maxY ? (startRho + (endRho - startRho) * y / me.maxY) : endRho;
        }

        return style;
    },

    updateDonut: function (donut) {
        var radius = this.getRadius();
        this.setStyle({
            startRho: radius * donut * 0.01,
            endRho: radius * this.getRadiusFactor() * 0.01
        });
        this.doUpdateStyles();
    },

    // Subtract 90 degrees from rotation, so that `rotation` config's default
    // zero value makes first pie sector start at noon, rather than 3 o'clock.
    rotationOffset: -Math.PI / 2,

    updateRotation: function (rotation) {
        this.setStyle({
            rotationRads: rotation + this.rotationOffset
        });
        this.doUpdateStyles();
    },

    updateTotalAngle: function (totalAngle) {
        this.processData();
    },

    getSprites: function () {
        var me = this,
            chart = me.getChart(),
            store = me.getStore();

        if (!chart || !store) {
            return [];
        }
        me.getColors();
        me.getSubStyle();

        var items = store.getData().items,
            length = items.length,
            animation = me.getAnimation() || chart && chart.getAnimation(),
            sprites = me.sprites, sprite,
            spriteIndex = 0, rendererData,
            i, spriteCreated = false,
            label = me.getLabel(),
            labelTpl = label.getTemplate();

        rendererData = {
            store: store,
            field: me.getField(),
            series: me
        };

        for (i = 0; i < length; i++) {
            sprite = sprites[i];
            if (!sprite) {
                sprite = me.createSprite();
                if (me.getHighlight()) {
                    sprite.config.highlight = me.getHighlight();
                    sprite.addModifier('highlight', true);
                }
                if (labelTpl.getField()) {
                    labelTpl.setAttributes({
                        labelOverflowPadding: me.getLabelOverflowPadding()
                    });
                    labelTpl.fx.setCustomDurations({'callout': 200});
                }
                sprite.setAttributes(me.getStyleByIndex(i));
                sprite.rendererData = rendererData;
                spriteCreated = true;
            }
            sprite.rendererIndex = spriteIndex++;
            sprite.fx.setConfig(animation);
        }
        if (spriteCreated) {
            me.doUpdateStyles();
        }
        return me.sprites;
    },

    betweenAngle: function (x, a, b) {
        var pp = Math.PI * 2,
            offset = this.rotationOffset;

        if (a === b) {
            return false;
        }

        if (!this.getClockwise()) {
            x *= -1;
            a *= -1;
            b *= -1;
            a -= offset;
            b -= offset;
        } else {
            a += offset;
            b += offset;
        }

        x -= a;
        b -= a;

        // Normalize, so that both x and b are in the [0,360) interval.
        x %= pp;
        b %= pp;
        x += pp;
        b += pp;
        x %= pp;
        b %= pp;

        // Because 360 * n angles will be normalized to 0,
        // we need to treat b === 0 as a special case.
        return x < b || b === 0;
    },

    /**
     * Returns the pie slice for a given angle
     * @param {Number} angle The angle to search for the slice
     * @return {Object} An object containing the reocord, sprite, scope etc.
     */
    getItemForAngle: function (angle) {
        var me = this,
            sprites = me.getSprites(),
            attr;

        angle %= Math.PI * 2;

        while (angle < 0) {
            angle += Math.PI * 2;
        }

        if (sprites) {
            var store  = me.getStore(),
                items  = store.getData().items,
                hidden = me.getHidden(),
                i      = 0,
                ln     = store.getCount();

            for (; i < ln; i++) {
                if(!hidden[i]) {
                    // Fortunately, item's id equals its index in the instances list.
                    attr = sprites[i].attr;

                    if (attr.startAngle <= angle &&  attr.endAngle >= angle) {
                        return {
                            series: me,
                            sprite: sprites[i],
                            index: i,
                            record: items[i],
                            field: me.getXField()
                        };
                    }
                }
            }
        }

        return null;
    },

    getItemForPoint: function (x, y) {
        var me = this,
            sprites = me.getSprites();

        if (sprites) {
            var center = me.getCenter(),
                offsetX = me.getOffsetX(),
                offsetY = me.getOffsetY(),
                // Distance from the center of the series to the cursor.
                dx = x - center[0] + offsetX,
                dy = y - center[1] + offsetY,
                store = me.getStore(),
                donut = me.getDonut(),
                records = store.getData().items,
                direction = Math.atan2(dy, dx) - me.getRotation(),
                radius = Math.sqrt(dx * dx + dy * dy),
                startRadius = me.getRadius() * donut * 0.01,
                hidden = me.getHidden(),
                i, ln, attr;

            for (i = 0, ln = records.length; i < ln; i++) {
                if (!hidden[i]) {
                    // Fortunately, item's id equals its index in the instances list.
                    attr = sprites[i].attr;
                    if (radius >= startRadius + attr.margin && radius <= attr.endRho + attr.margin) {
                        if (me.betweenAngle(direction, attr.startAngle, attr.endAngle)) {
                            return {
                                series: me,
                                sprite: sprites[i],
                                index: i,
                                record: records[i],
                                field: me.getXField()
                            };
                        }
                    }
                }
            }
            return null;
        }
    },

    provideLegendInfo: function (target) {
        var me = this,
            store = me.getStore();
        if (store) {
            var items = store.getData().items,
                labelField = me.getLabel().getTemplate().getField(),
                field = me.getField(),
                hidden = me.getHidden(),
                i, style, fill;

            for (i = 0; i < items.length; i++) {
                style = me.getStyleByIndex(i);
                fill = style.fillStyle;
                if (Ext.isObject(fill)) {
                    fill = fill.stops && fill.stops[0].color;
                }
                target.push({
                    name: labelField ? String(items[i].get(labelField))  : field + ' ' + i,
                    mark: fill || style.strokeStyle || 'black',
                    disabled: hidden[i],
                    series: me.getId(),
                    index: i
                });
            }
        }
    }
});

/*
    Moved TODO comments to bottom:
    TODO: `contrast` is not supported. Should be in the series.label config.
    TODO: We set `contrast` to `true` to flip the color of the label if it is to similar
    to the background color. Finally, we set the font family
    TODO: and size through the `font` parameter.
*/


text:
'use strict';

var util = require('util');

function ConstraintError(message) {
    this.name = this.constructor.name;
    this.message = message !== undefined ? message : ' A mutation operation in the transaction failed because a constraint was not satisfied. For example, an object such as an object store or index already exists and a request attempted to create a new one.';
    if (Error.captureStackTrace) {
        Error.captureStackTrace(this, ConstraintError);
    }
}
util.inherits(ConstraintError, Error);

module.exports = ConstraintError;


text:
package sqlline;

import java.util.Collections;
import java.util.List;

import jline.console.completer.Completer;

/**
 * A {@link CommandHandler} implementation that
 * uses reflection to determine the method to dispatch the command.
 */
public class ReflectiveCommandHandler extends AbstractCommandHandler {
  public ReflectiveCommandHandler(SqlLine sqlLine, List<Completer> completers,
      String... cmds) {
    super(sqlLine, cmds, sqlLine.loc("help-" + cmds[0]), completers);
  }

  public ReflectiveCommandHandler(SqlLine sqlLine, Completer completer,
      String... cmds) {
    this(sqlLine, Collections.<Completer>singletonList(completer), cmds);
  }

  public void execute(String line, DispatchCallback callback) {
    try {
      sqlLine.getCommands().getClass()
          .getMethod(getName(), String.class, DispatchCallback.class)
          .invoke(sqlLine.getCommands(), line, callback);
    } catch (Throwable e) {
      callback.setToFailure();
      sqlLine.error(e);
    }
  }
}

// End ReflectiveCommandHandler.java