com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo Java Examples

The following examples show how to use com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PropertyFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #2
Source File: TransducedAccessor.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the {@link TransducedAccessor} appropriately configured for
 * the given property.
 *
 * <p>
 * This allows the implementation to use an optimized code.
 */
public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref) {
    Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
    RuntimePropertyInfo prop = ref.getSource();

    if(prop.isCollection()) {
        return new ListTransducedAccessorImpl(xducer,prop.getAccessor(),
                Lister.create(Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()), prop.id(), prop.getAdapter()));
    }

    if(prop.id()==ID.IDREF)
        return new IDREFTransducedAccessorImpl(prop.getAccessor());

    if(xducer.isDefault() && context != null && !context.fastBoot) {
        TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
        if(xa!=null)    return xa;
    }

    if(xducer.useNamespace())
        return new CompositeContextDependentTransducedAccessorImpl( context, xducer, prop.getAccessor() );
    else
        return new CompositeTransducedAccessorImpl( context, xducer, prop.getAccessor() );
}
 
Example #3
Source File: TransducedAccessor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the {@link TransducedAccessor} appropriately configured for
 * the given property.
 *
 * <p>
 * This allows the implementation to use an optimized code.
 */
public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref) {
    Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
    RuntimePropertyInfo prop = ref.getSource();

    if(prop.isCollection()) {
        return new ListTransducedAccessorImpl(xducer,prop.getAccessor(),
                Lister.create(Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()), prop.id(), prop.getAdapter()));
    }

    if(prop.id()==ID.IDREF)
        return new IDREFTransducedAccessorImpl(prop.getAccessor());

    if(xducer.isDefault() && context != null && !context.fastBoot) {
        TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
        if(xa!=null)    return xa;
    }

    if(xducer.useNamespace())
        return new CompositeContextDependentTransducedAccessorImpl( context, xducer, prop.getAccessor() );
    else
        return new CompositeTransducedAccessorImpl( context, xducer, prop.getAccessor() );
}
 
Example #4
Source File: ModelBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Getting parametrized classes of {@code JAXBElement<...>} property
 * @param p property which parametrized types we will try to get
 * @return null - if it's not JAXBElement property, or it's not parametrized, and array of parametrized classes in other case
 */
private Class[] getParametrizedTypes(PropertyInfo p) {
    try {
        Type pType = ((RuntimePropertyInfo) p).getIndividualType();
        if (pType instanceof ParameterizedType) {
            ParameterizedType prmzdType = (ParameterizedType) pType;
            if (prmzdType.getRawType() == JAXBElement.class) {
                Type[] actualTypes = prmzdType.getActualTypeArguments();
                Class[] result = new Class[actualTypes.length];
                for (int i = 0; i < actualTypes.length; i++) {
                    result[i] = (Class) actualTypes[i];
                }
                return result;
            }
        }
    } catch (Exception e) {
        logger.log(Level.FINE, "Error in ModelBuilder.getParametrizedTypes. " + e.getMessage());
    }
    return null;
}
 
Example #5
Source File: PropertyFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #6
Source File: ModelBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Getting parametrized classes of {@code JAXBElement<...>} property
 * @param p property which parametrized types we will try to get
 * @return null - if it's not JAXBElement property, or it's not parametrized, and array of parametrized classes in other case
 */
private Class[] getParametrizedTypes(PropertyInfo p) {
    try {
        Type pType = ((RuntimePropertyInfo) p).getIndividualType();
        if (pType instanceof ParameterizedType) {
            ParameterizedType prmzdType = (ParameterizedType) pType;
            if (prmzdType.getRawType() == JAXBElement.class) {
                Type[] actualTypes = prmzdType.getActualTypeArguments();
                Class[] result = new Class[actualTypes.length];
                for (int i = 0; i < actualTypes.length; i++) {
                    result[i] = (Class) actualTypes[i];
                }
                return result;
            }
        }
    } catch (Exception e) {
        logger.log(Level.FINE, "Error in ModelBuilder.getParametrizedTypes. " + e.getMessage());
    }
    return null;
}
 
Example #7
Source File: TransducedAccessor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the {@link TransducedAccessor} appropriately configured for
 * the given property.
 *
 * <p>
 * This allows the implementation to use an optimized code.
 */
public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref) {
    Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
    RuntimePropertyInfo prop = ref.getSource();

    if(prop.isCollection()) {
        return new ListTransducedAccessorImpl(xducer,prop.getAccessor(),
                Lister.create(Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()), prop.id(), prop.getAdapter()));
    }

    if(prop.id()==ID.IDREF)
        return new IDREFTransducedAccessorImpl(prop.getAccessor());

    if(xducer.isDefault() && context != null && !context.fastBoot) {
        TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
        if(xa!=null)    return xa;
    }

    if(xducer.useNamespace())
        return new CompositeContextDependentTransducedAccessorImpl( context, xducer, prop.getAccessor() );
    else
        return new CompositeTransducedAccessorImpl( context, xducer, prop.getAccessor() );
}
 
Example #8
Source File: PropertyFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #9
Source File: PropertyFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #10
Source File: PropertyFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #11
Source File: PropertyFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look for the case that can be optimized as a leaf,
 * which is a kind of type whose XML representation is just PCDATA.
 */
static boolean isLeaf(RuntimePropertyInfo info) {
    Collection<? extends RuntimeTypeInfo> types = info.ref();
    if(types.size()!=1)     return false;

    RuntimeTypeInfo rti = types.iterator().next();
    if(!(rti instanceof RuntimeNonElement)) return false;

    if(info.id()==ID.IDREF)
        // IDREF is always handled as leaf -- Transducer maps IDREF String back to an object
        return true;

    if(((RuntimeNonElement)rti).getTransducer()==null)
        // Transducer!=null means definitely binds to PCDATA.
        // even if transducer==null, a referene might be IDREF,
        // in which case it will still produce PCDATA in this reference.
        return false;

    if(!info.getIndividualType().equals(rti.getType()))
        return false;

    return true;
}
 
Example #12
Source File: TransducedAccessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the {@link TransducedAccessor} appropriately configured for
 * the given property.
 *
 * <p>
 * This allows the implementation to use an optimized code.
 */
public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref) {
    Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
    RuntimePropertyInfo prop = ref.getSource();

    if(prop.isCollection()) {
        return new ListTransducedAccessorImpl(xducer,prop.getAccessor(),
                Lister.create(Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()), prop.id(), prop.getAdapter()));
    }

    if(prop.id()==ID.IDREF)
        return new IDREFTransducedAccessorImpl(prop.getAccessor());

    if(xducer.isDefault() && context != null && !context.fastBoot) {
        TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
        if(xa!=null)    return xa;
    }

    if(xducer.useNamespace())
        return new CompositeContextDependentTransducedAccessorImpl( context, xducer, prop.getAccessor() );
    else
        return new CompositeTransducedAccessorImpl( context, xducer, prop.getAccessor() );
}
 
Example #13
Source File: ModelBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Getting parametrized classes of {@code JAXBElement<...>} property
 * @param p property which parametrized types we will try to get
 * @return null - if it's not JAXBElement property, or it's not parametrized, and array of parametrized classes in other case
 */
private Class[] getParametrizedTypes(PropertyInfo p) {
    try {
        Type pType = ((RuntimePropertyInfo) p).getIndividualType();
        if (pType instanceof ParameterizedType) {
            ParameterizedType prmzdType = (ParameterizedType) pType;
            if (prmzdType.getRawType() == JAXBElement.class) {
                Type[] actualTypes = prmzdType.getActualTypeArguments();
                Class[] result = new Class[actualTypes.length];
                for (int i = 0; i < actualTypes.length; i++) {
                    result[i] = (Class) actualTypes[i];
                }
                return result;
            }
        }
    } catch (Exception e) {
        logger.log(Level.FINE, "Error in ModelBuilder.getParametrizedTypes. " + e.getMessage());
    }
    return null;
}
 
Example #14
Source File: TransducedAccessor.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the {@link TransducedAccessor} appropriately configured for
 * the given property.
 *
 * <p>
 * This allows the implementation to use an optimized code.
 */
public static <T> TransducedAccessor<T> get(JAXBContextImpl context, RuntimeNonElementRef ref) {
    Transducer xducer = RuntimeModelBuilder.createTransducer(ref);
    RuntimePropertyInfo prop = ref.getSource();

    if(prop.isCollection()) {
        return new ListTransducedAccessorImpl(xducer,prop.getAccessor(),
                Lister.create(Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()), prop.id(), prop.getAdapter()));
    }

    if(prop.id()==ID.IDREF)
        return new IDREFTransducedAccessorImpl(prop.getAccessor());

    if(xducer.isDefault() && context != null && !context.fastBoot) {
        TransducedAccessor xa = OptimizedTransducedAccessorFactory.get(prop);
        if(xa!=null)    return xa;
    }

    if(xducer.useNamespace())
        return new CompositeContextDependentTransducedAccessorImpl( context, xducer, prop.getAccessor() );
    else
        return new CompositeTransducedAccessorImpl( context, xducer, prop.getAccessor() );
}
 
Example #15
Source File: ModelBuilder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Getting parametrized classes of {@code JAXBElement<...>} property
 * @param p property which parametrized types we will try to get
 * @return null - if it's not JAXBElement property, or it's not parametrized, and array of parametrized classes in other case
 */
private Class[] getParametrizedTypes(PropertyInfo p) {
    try {
        Type pType = ((RuntimePropertyInfo) p).getIndividualType();
        if (pType instanceof ParameterizedType) {
            ParameterizedType prmzdType = (ParameterizedType) pType;
            if (prmzdType.getRawType() == JAXBElement.class) {
                Type[] actualTypes = prmzdType.getActualTypeArguments();
                Class[] result = new Class[actualTypes.length];
                for (int i = 0; i < actualTypes.length; i++) {
                    result[i] = (Class) actualTypes[i];
                }
                return result;
            }
        }
    } catch (Exception e) {
        logger.log(Level.FINE, "Error in ModelBuilder.getParametrizedTypes. " + e.getMessage());
    }
    return null;
}
 
Example #16
Source File: ModelBuilder.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Getting parametrized classes of {@code JAXBElement<...>} property
 * @param p property which parametrized types we will try to get
 * @return null - if it's not JAXBElement property, or it's not parametrized, and array of parametrized classes in other case
 */
private Class[] getParametrizedTypes(PropertyInfo p) {
    try {
        Type pType = ((RuntimePropertyInfo) p).getIndividualType();
        if (pType instanceof ParameterizedType) {
            ParameterizedType prmzdType = (ParameterizedType) pType;
            if (prmzdType.getRawType() == JAXBElement.class) {
                Type[] actualTypes = prmzdType.getActualTypeArguments();
                Class[] result = new Class[actualTypes.length];
                for (int i = 0; i < actualTypes.length; i++) {
                    result[i] = (Class) actualTypes[i];
                }
                return result;
            }
        }
    } catch (Exception e) {
        logger.log(Level.FINE, "Error in ModelBuilder.getParametrizedTypes. " + e.getMessage());
    }
    return null;
}
 
Example #17
Source File: ArrayERProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected ArrayERProperty(JAXBContextImpl grammar, RuntimePropertyInfo prop, QName tagName, boolean isWrapperNillable) {
    super(grammar,prop);
    if(tagName==null)
        this.wrapperTagName = null;
    else
        this.wrapperTagName = grammar.nameBuilder.createElementName(tagName);
    this.isWrapperNillable = isWrapperNillable;
}
 
Example #18
Source File: SingleTypePropertyInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public SingleTypePropertyInfoImpl(ClassInfoImpl<T,C,F,M> classInfo, PropertySeed<T,C,F,M> seed) {
    super(classInfo, seed);
    if(this instanceof RuntimePropertyInfo) {
        Accessor rawAcc = ((RuntimeClassInfoImpl.RuntimePropertySeed)seed).getAccessor();
        if(getAdapter()!=null && !isCollection())
            // adapter for a single-value property is handled by accessor.
            // adapter for a collection property is handled by lister.
            rawAcc = rawAcc.adapt(((RuntimePropertyInfo)this).getAdapter());
        this.acc = rawAcc;
    } else
        this.acc = null;
}
 
Example #19
Source File: ArrayProperty.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected ArrayProperty(JAXBContextImpl context, RuntimePropertyInfo prop) {
    super(context,prop);

    assert prop.isCollection();
    lister = Lister.create(
        Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()),prop.id(),prop.getAdapter());
    assert lister!=null;
    acc = prop.getAccessor().optimize(context);
    assert acc!=null;
}
 
Example #20
Source File: ArrayERProperty.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected ArrayERProperty(JAXBContextImpl grammar, RuntimePropertyInfo prop, QName tagName, boolean isWrapperNillable) {
    super(grammar,prop);
    if(tagName==null)
        this.wrapperTagName = null;
    else
        this.wrapperTagName = grammar.nameBuilder.createElementName(tagName);
    this.isWrapperNillable = isWrapperNillable;
}
 
Example #21
Source File: ArrayERProperty.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected ArrayERProperty(JAXBContextImpl grammar, RuntimePropertyInfo prop, QName tagName, boolean isWrapperNillable) {
    super(grammar,prop);
    if(tagName==null)
        this.wrapperTagName = null;
    else
        this.wrapperTagName = grammar.nameBuilder.createElementName(tagName);
    this.isWrapperNillable = isWrapperNillable;
}
 
Example #22
Source File: SingleTypePropertyInfoImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public SingleTypePropertyInfoImpl(ClassInfoImpl<T,C,F,M> classInfo, PropertySeed<T,C,F,M> seed) {
    super(classInfo, seed);
    if(this instanceof RuntimePropertyInfo) {
        Accessor rawAcc = ((RuntimeClassInfoImpl.RuntimePropertySeed)seed).getAccessor();
        if(getAdapter()!=null && !isCollection())
            // adapter for a single-value property is handled by accessor.
            // adapter for a collection property is handled by lister.
            rawAcc = rawAcc.adapt(((RuntimePropertyInfo)this).getAdapter());
        this.acc = rawAcc;
    } else
        this.acc = null;
}
 
Example #23
Source File: SingleTypePropertyInfoImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public SingleTypePropertyInfoImpl(ClassInfoImpl<T,C,F,M> classInfo, PropertySeed<T,C,F,M> seed) {
    super(classInfo, seed);
    if(this instanceof RuntimePropertyInfo) {
        Accessor rawAcc = ((RuntimeClassInfoImpl.RuntimePropertySeed)seed).getAccessor();
        if(getAdapter()!=null && !isCollection())
            // adapter for a single-value property is handled by accessor.
            // adapter for a collection property is handled by lister.
            rawAcc = rawAcc.adapt(((RuntimePropertyInfo)this).getAdapter());
        this.acc = rawAcc;
    } else
        this.acc = null;
}
 
Example #24
Source File: SingleTypePropertyInfoImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public SingleTypePropertyInfoImpl(ClassInfoImpl<T,C,F,M> classInfo, PropertySeed<T,C,F,M> seed) {
    super(classInfo, seed);
    if(this instanceof RuntimePropertyInfo) {
        Accessor rawAcc = ((RuntimeClassInfoImpl.RuntimePropertySeed)seed).getAccessor();
        if(getAdapter()!=null && !isCollection())
            // adapter for a single-value property is handled by accessor.
            // adapter for a collection property is handled by lister.
            rawAcc = rawAcc.adapt(((RuntimePropertyInfo)this).getAdapter());
        this.acc = rawAcc;
    } else
        this.acc = null;
}
 
Example #25
Source File: ArrayProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected ArrayProperty(JAXBContextImpl context, RuntimePropertyInfo prop) {
    super(context,prop);

    assert prop.isCollection();
    lister = Lister.create(
        Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()),prop.id(),prop.getAdapter());
    assert lister!=null;
    acc = prop.getAccessor().optimize(context);
    assert acc!=null;
}
 
Example #26
Source File: ArrayProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected ArrayProperty(JAXBContextImpl context, RuntimePropertyInfo prop) {
    super(context,prop);

    assert prop.isCollection();
    lister = Lister.create(
        Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()),prop.id(),prop.getAdapter());
    assert lister!=null;
    acc = prop.getAccessor().optimize(context);
    assert acc!=null;
}
 
Example #27
Source File: ArrayERProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected ArrayERProperty(JAXBContextImpl grammar, RuntimePropertyInfo prop, QName tagName, boolean isWrapperNillable) {
    super(grammar,prop);
    if(tagName==null)
        this.wrapperTagName = null;
    else
        this.wrapperTagName = grammar.nameBuilder.createElementName(tagName);
    this.isWrapperNillable = isWrapperNillable;
}
 
Example #28
Source File: ArrayProperty.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected ArrayProperty(JAXBContextImpl context, RuntimePropertyInfo prop) {
    super(context,prop);

    assert prop.isCollection();
    lister = Lister.create(
        Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()),prop.id(),prop.getAdapter());
    assert lister!=null;
    acc = prop.getAccessor().optimize(context);
    assert acc!=null;
}
 
Example #29
Source File: SingleTypePropertyInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public SingleTypePropertyInfoImpl(ClassInfoImpl<T,C,F,M> classInfo, PropertySeed<T,C,F,M> seed) {
    super(classInfo, seed);
    if(this instanceof RuntimePropertyInfo) {
        Accessor rawAcc = ((RuntimeClassInfoImpl.RuntimePropertySeed)seed).getAccessor();
        if(getAdapter()!=null && !isCollection())
            // adapter for a single-value property is handled by accessor.
            // adapter for a collection property is handled by lister.
            rawAcc = rawAcc.adapt(((RuntimePropertyInfo)this).getAdapter());
        this.acc = rawAcc;
    } else
        this.acc = null;
}
 
Example #30
Source File: ArrayProperty.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected ArrayProperty(JAXBContextImpl context, RuntimePropertyInfo prop) {
    super(context,prop);

    assert prop.isCollection();
    lister = Lister.create(
        Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()),prop.id(),prop.getAdapter());
    assert lister!=null;
    acc = prop.getAccessor().optimize(context);
    assert acc!=null;
}