com.sun.tools.internal.xjc.generator.bean.field.FieldRenderer Java Examples

The following examples show how to use com.sun.tools.internal.xjc.generator.bean.field.FieldRenderer. 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: BIAttribute.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    Attr a = element.getAttributeNode("collection");
    if(a==null)     return null;

    String v = element.getAttribute("collection").trim();

    FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
    if(v.equals("array"))   return frf.getArray();
    if(v.equals("list"))
        return frf.getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #2
Source File: BIAttribute.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    Attr a = element.getAttributeNode("collection");
    if(a==null)     return null;

    String v = element.getAttribute("collection").trim();

    FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
    if(v.equals("array"))   return frf.getArray();
    if(v.equals("list"))
        return frf.getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #3
Source File: BIAttribute.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    Attr a = element.getAttributeNode("collection");
    if(a==null)     return null;

    String v = element.getAttribute("collection").trim();

    FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
    if(v.equals("array"))   return frf.getArray();
    if(v.equals("list"))
        return frf.getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #4
Source File: BIAttribute.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    Attr a = element.getAttributeNode("collection");
    if(a==null)     return null;

    String v = element.getAttribute("collection").trim();

    FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
    if(v.equals("array"))   return frf.getArray();
    if(v.equals("list"))
        return frf.getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #5
Source File: BIAttribute.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    Attr a = element.getAttributeNode("collection");
    if(a==null)     return null;

    String v = element.getAttribute("collection").trim();

    FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
    if(v.equals("array"))   return frf.getArray();
    if(v.equals("list"))
        return frf.getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #6
Source File: BIAttribute.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    Attr a = element.getAttributeNode("collection");
    if(a==null)     return null;

    String v = element.getAttribute("collection").trim();

    FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
    if(v.equals("array"))   return frf.getArray();
    if(v.equals("list"))
        return frf.getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #7
Source File: BIAttribute.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    Attr a = element.getAttributeNode("collection");
    if(a==null)     return null;

    String v = element.getAttribute("collection").trim();

    FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
    if(v.equals("array"))   return frf.getArray();
    if(v.equals("list"))
        return frf.getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #8
Source File: BIAttribute.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    Attr a = element.getAttributeNode("collection");
    if(a==null)     return null;

    String v = element.getAttribute("collection").trim();

    FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
    if(v.equals("array"))   return frf.getArray();
    if(v.equals("list"))
        return frf.getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #9
Source File: BeanGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines the FieldRenderer used for the given FieldUse,
 * then generates the field declaration and accessor methods.
 *
 * The <code>fields</code> map will be updated with the newly
 * created FieldRenderer.
 */
private FieldOutline generateFieldDecl(ClassOutlineImpl cc, CPropertyInfo prop) {
    FieldRenderer fr = prop.realization;
    if (fr == null) // none is specified. use the default factory
    {
        fr = model.options.getFieldRendererFactory().getDefault();
    }

    FieldOutline field = fr.generate(cc, prop);
    fields.put(prop, field);

    return field;
}
 
Example #10
Source File: CollectionTypeAttribute.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private FieldRenderer calcFr(Model m) {
    FieldRendererFactory frf = m.options.getFieldRendererFactory();
    if (collectionType==null)
        return frf.getDefault();

    if (collectionType.equals("indexed"))
        return frf.getArray();

    return frf.getList(m.codeModel.ref(collectionType));
}
 
Example #11
Source File: BIContent.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    String v = DOMUtil.getAttribute(element,"collection");
    if(v==null)     return null;

    v = v.trim();
    if(v.equals("array"))   return opts.getFieldRendererFactory().getArray();
    if(v.equals("list"))
        return opts.getFieldRendererFactory().getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #12
Source File: BeanGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines the FieldRenderer used for the given FieldUse,
 * then generates the field declaration and accessor methods.
 *
 * The <code>fields</code> map will be updated with the newly
 * created FieldRenderer.
 */
private FieldOutline generateFieldDecl(ClassOutlineImpl cc, CPropertyInfo prop) {
    FieldRenderer fr = prop.realization;
    if (fr == null) // none is specified. use the default factory
    {
        fr = model.options.getFieldRendererFactory().getDefault();
    }

    FieldOutline field = fr.generate(cc, prop);
    fields.put(prop, field);

    return field;
}
 
Example #13
Source File: CollectionTypeAttribute.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private FieldRenderer calcFr(Model m) {
    FieldRendererFactory frf = m.options.getFieldRendererFactory();
    if (collectionType==null)
        return frf.getDefault();

    if (collectionType.equals("indexed"))
        return frf.getArray();

    return frf.getList(m.codeModel.ref(collectionType));
}
 
Example #14
Source File: BIContent.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    String v = DOMUtil.getAttribute(element,"collection");
    if(v==null)     return null;

    v = v.trim();
    if(v.equals("array"))   return opts.getFieldRendererFactory().getArray();
    if(v.equals("list"))
        return opts.getFieldRendererFactory().getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #15
Source File: BeanGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines the FieldRenderer used for the given FieldUse,
 * then generates the field declaration and accessor methods.
 *
 * The <code>fields</code> map will be updated with the newly
 * created FieldRenderer.
 */
private FieldOutline generateFieldDecl(ClassOutlineImpl cc, CPropertyInfo prop) {
    FieldRenderer fr = prop.realization;
    if (fr == null) // none is specified. use the default factory
    {
        fr = model.options.getFieldRendererFactory().getDefault();
    }

    FieldOutline field = fr.generate(cc, prop);
    fields.put(prop, field);

    return field;
}
 
Example #16
Source File: CollectionTypeAttribute.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private FieldRenderer calcFr(Model m) {
    FieldRendererFactory frf = m.options.getFieldRendererFactory();
    if (collectionType==null)
        return frf.getDefault();

    if (collectionType.equals("indexed"))
        return frf.getArray();

    return frf.getList(m.codeModel.ref(collectionType));
}
 
Example #17
Source File: BIContent.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    String v = DOMUtil.getAttribute(element,"collection");
    if(v==null)     return null;

    v = v.trim();
    if(v.equals("array"))   return opts.getFieldRendererFactory().getArray();
    if(v.equals("list"))
        return opts.getFieldRendererFactory().getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #18
Source File: BeanGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines the FieldRenderer used for the given FieldUse,
 * then generates the field declaration and accessor methods.
 *
 * The <code>fields</code> map will be updated with the newly
 * created FieldRenderer.
 */
private FieldOutline generateFieldDecl(ClassOutlineImpl cc, CPropertyInfo prop) {
    FieldRenderer fr = prop.realization;
    if (fr == null) // none is specified. use the default factory
    {
        fr = model.options.getFieldRendererFactory().getDefault();
    }

    FieldOutline field = fr.generate(cc, prop);
    fields.put(prop, field);

    return field;
}
 
Example #19
Source File: CollectionTypeAttribute.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private FieldRenderer calcFr(Model m) {
    FieldRendererFactory frf = m.options.getFieldRendererFactory();
    if (collectionType==null)
        return frf.getDefault();

    if (collectionType.equals("indexed"))
        return frf.getArray();

    return frf.getList(m.codeModel.ref(collectionType));
}
 
Example #20
Source File: BIContent.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    String v = DOMUtil.getAttribute(element,"collection");
    if(v==null)     return null;

    v = v.trim();
    if(v.equals("array"))   return opts.getFieldRendererFactory().getArray();
    if(v.equals("list"))
        return opts.getFieldRendererFactory().getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #21
Source File: BeanGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines the FieldRenderer used for the given FieldUse,
 * then generates the field declaration and accessor methods.
 *
 * The <code>fields</code> map will be updated with the newly
 * created FieldRenderer.
 */
private FieldOutline generateFieldDecl(ClassOutlineImpl cc, CPropertyInfo prop) {
    FieldRenderer fr = prop.realization;
    if (fr == null) // none is specified. use the default factory
    {
        fr = model.options.getFieldRendererFactory().getDefault();
    }

    FieldOutline field = fr.generate(cc, prop);
    fields.put(prop, field);

    return field;
}
 
Example #22
Source File: BIContent.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    String v = DOMUtil.getAttribute(element,"collection");
    if(v==null)     return null;

    v = v.trim();
    if(v.equals("array"))   return opts.getFieldRendererFactory().getArray();
    if(v.equals("list"))
        return opts.getFieldRendererFactory().getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #23
Source File: CollectionTypeAttribute.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private FieldRenderer calcFr(Model m) {
    FieldRendererFactory frf = m.options.getFieldRendererFactory();
    if (collectionType==null)
        return frf.getDefault();

    if (collectionType.equals("indexed"))
        return frf.getArray();

    return frf.getList(m.codeModel.ref(collectionType));
}
 
Example #24
Source File: CollectionTypeAttribute.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private FieldRenderer calcFr(Model m) {
    FieldRendererFactory frf = m.options.getFieldRendererFactory();
    if (collectionType==null)
        return frf.getDefault();

    if (collectionType.equals("indexed"))
        return frf.getArray();

    return frf.getList(m.codeModel.ref(collectionType));
}
 
Example #25
Source File: BeanGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines the FieldRenderer used for the given FieldUse,
 * then generates the field declaration and accessor methods.
 *
 * The <code>fields</code> map will be updated with the newly
 * created FieldRenderer.
 */
private FieldOutline generateFieldDecl(ClassOutlineImpl cc, CPropertyInfo prop) {
    FieldRenderer fr = prop.realization;
    if (fr == null) // none is specified. use the default factory
    {
        fr = model.options.getFieldRendererFactory().getDefault();
    }

    FieldOutline field = fr.generate(cc, prop);
    fields.put(prop, field);

    return field;
}
 
Example #26
Source File: BIContent.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    String v = DOMUtil.getAttribute(element,"collection");
    if(v==null)     return null;

    v = v.trim();
    if(v.equals("array"))   return opts.getFieldRendererFactory().getArray();
    if(v.equals("list"))
        return opts.getFieldRendererFactory().getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #27
Source File: BIContent.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Gets the realization of this particle, if any.
 *
 * @return
 *      null if the "collection" attribute was not specified.
 */
public final FieldRenderer getRealization() {
    String v = DOMUtil.getAttribute(element,"collection");
    if(v==null)     return null;

    v = v.trim();
    if(v.equals("array"))   return opts.getFieldRendererFactory().getArray();
    if(v.equals("list"))
        return opts.getFieldRendererFactory().getList(
            parent.parent.codeModel.ref(ArrayList.class));

    // the correctness of the attribute value must be
    // checked by the validator.
    throw new InternalError("unexpected collection value: "+v);
}
 
Example #28
Source File: CollectionTypeAttribute.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private FieldRenderer calcFr(Model m) {
    FieldRendererFactory frf = m.options.getFieldRendererFactory();
    if (collectionType==null)
        return frf.getDefault();

    if (collectionType.equals("indexed"))
        return frf.getArray();

    return frf.getList(m.codeModel.ref(collectionType));
}
 
Example #29
Source File: BeanGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines the FieldRenderer used for the given FieldUse,
 * then generates the field declaration and accessor methods.
 *
 * The <code>fields</code> map will be updated with the newly
 * created FieldRenderer.
 */
private FieldOutline generateFieldDecl(ClassOutlineImpl cc, CPropertyInfo prop) {
    FieldRenderer fr = prop.realization;
    if (fr == null) // none is specified. use the default factory
    {
        fr = model.options.getFieldRendererFactory().getDefault();
    }

    FieldOutline field = fr.generate(cc, prop);
    fields.put(prop, field);

    return field;
}
 
Example #30
Source File: BeanGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines the FieldRenderer used for the given FieldUse,
 * then generates the field declaration and accessor methods.
 *
 * The <code>fields</code> map will be updated with the newly
 * created FieldRenderer.
 */
private FieldOutline generateFieldDecl(ClassOutlineImpl cc, CPropertyInfo prop) {
    FieldRenderer fr = prop.realization;
    if (fr == null) // none is specified. use the default factory
    {
        fr = model.options.getFieldRendererFactory().getDefault();
    }

    FieldOutline field = fr.generate(cc, prop);
    fields.put(prop, field);

    return field;
}