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

The following examples show how to use com.sun.tools.internal.xjc.generator.bean.field.FieldRendererFactory. 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 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 #2
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 #3
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 #4
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 #5
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 #6
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 #7
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 #8
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 #9
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 #10
Source File: BGMBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #11
Source File: BGMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #12
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 #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: BGMBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #15
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 #16
Source File: Options.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the {@link FieldRendererFactory}.
 * <p>
 * <p>
 * This method is for plugins to call to set a custom {@link FieldRendererFactory}.
 *
 * @param frf   The {@link FieldRendererFactory} to be installed. Must not be null.
 * @param owner Identifies the plugin that owns this {@link FieldRendererFactory}.
 *              When two {@link Plugin}s try to call this method, this allows XJC
 *              to report it as a user-friendly error message.
 * @throws BadCommandLineException If a conflit happens, this exception carries a user-friendly error
 *                                 message, indicating a conflict.
 */
public void setFieldRendererFactory(FieldRendererFactory frf, Plugin owner) throws BadCommandLineException {
    // since this method is for plugins, make it bit more fool-proof than usual
    if (frf == null)
        throw new IllegalArgumentException();
    if (fieldRendererFactoryOwner != null) {
        throw new BadCommandLineException(
            Messages.format(Messages.FIELD_RENDERER_CONFLICT,
                fieldRendererFactoryOwner.getOptionName(),
                owner.getOptionName()));
    }
    this.fieldRendererFactoryOwner = owner;
    this.fieldRendererFactory = frf;
}
 
Example #17
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 #18
Source File: BGMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #19
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 #20
Source File: BGMBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #21
Source File: BGMBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #22
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 #23
Source File: BGMBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #24
Source File: BGMBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected BGMBuilder(String defaultPackage1, String defaultPackage2,
        boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory,
        List<Plugin> activePlugins) {
    this.inExtensionMode = _inExtensionMode;
    this.defaultPackage1 = defaultPackage1;
    this.defaultPackage2 = defaultPackage2;
    this.fieldRendererFactory = fieldRendererFactory;
    this.activePlugins = activePlugins;
    promoteGlobalBindings();
}
 
Example #25
Source File: CollectionTypeAttribute.java    From jdk8u60 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 #26
Source File: Options.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the {@link FieldRendererFactory}.
 *
 * <p>
 * This method is for plugins to call to set a custom {@link FieldRendererFactory}.
 *
 * @param frf
 *      The {@link FieldRendererFactory} to be installed. Must not be null.
 * @param owner
 *      Identifies the plugin that owns this {@link FieldRendererFactory}.
 *      When two {@link Plugin}s try to call this method, this allows XJC
 *      to report it as a user-friendly error message.
 *
 * @throws BadCommandLineException
 *      If a conflit happens, this exception carries a user-friendly error
 *      message, indicating a conflict.
 */
public void setFieldRendererFactory(FieldRendererFactory frf, Plugin owner) throws BadCommandLineException {
    // since this method is for plugins, make it bit more fool-proof than usual
    if(frf==null)
        throw new IllegalArgumentException();
    if(fieldRendererFactoryOwner!=null) {
        throw new BadCommandLineException(
            Messages.format(Messages.FIELD_RENDERER_CONFLICT,
                fieldRendererFactoryOwner.getOptionName(),
                owner.getOptionName() ));
    }
    this.fieldRendererFactoryOwner = owner;
    this.fieldRendererFactory = frf;
}
 
Example #27
Source File: Options.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the {@link FieldRendererFactory}.
 *
 * <p>
 * This method is for plugins to call to set a custom {@link FieldRendererFactory}.
 *
 * @param frf
 *      The {@link FieldRendererFactory} to be installed. Must not be null.
 * @param owner
 *      Identifies the plugin that owns this {@link FieldRendererFactory}.
 *      When two {@link Plugin}s try to call this method, this allows XJC
 *      to report it as a user-friendly error message.
 *
 * @throws BadCommandLineException
 *      If a conflit happens, this exception carries a user-friendly error
 *      message, indicating a conflict.
 */
public void setFieldRendererFactory(FieldRendererFactory frf, Plugin owner) throws BadCommandLineException {
    // since this method is for plugins, make it bit more fool-proof than usual
    if(frf==null)
        throw new IllegalArgumentException();
    if(fieldRendererFactoryOwner!=null) {
        throw new BadCommandLineException(
            Messages.format(Messages.FIELD_RENDERER_CONFLICT,
                fieldRendererFactoryOwner.getOptionName(),
                owner.getOptionName() ));
    }
    this.fieldRendererFactoryOwner = owner;
    this.fieldRendererFactory = frf;
}
 
Example #28
Source File: Options.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the {@link FieldRendererFactory}.
 *
 * <p>
 * This method is for plugins to call to set a custom {@link FieldRendererFactory}.
 *
 * @param frf
 *      The {@link FieldRendererFactory} to be installed. Must not be null.
 * @param owner
 *      Identifies the plugin that owns this {@link FieldRendererFactory}.
 *      When two {@link Plugin}s try to call this method, this allows XJC
 *      to report it as a user-friendly error message.
 *
 * @throws BadCommandLineException
 *      If a conflit happens, this exception carries a user-friendly error
 *      message, indicating a conflict.
 */
public void setFieldRendererFactory(FieldRendererFactory frf, Plugin owner) throws BadCommandLineException {
    // since this method is for plugins, make it bit more fool-proof than usual
    if(frf==null)
        throw new IllegalArgumentException();
    if(fieldRendererFactoryOwner!=null) {
        throw new BadCommandLineException(
            Messages.format(Messages.FIELD_RENDERER_CONFLICT,
                fieldRendererFactoryOwner.getOptionName(),
                owner.getOptionName() ));
    }
    this.fieldRendererFactoryOwner = owner;
    this.fieldRendererFactory = frf;
}
 
Example #29
Source File: Options.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the {@link FieldRendererFactory}.
 *
 * <p>
 * This method is for plugins to call to set a custom {@link FieldRendererFactory}.
 *
 * @param frf
 *      The {@link FieldRendererFactory} to be installed. Must not be null.
 * @param owner
 *      Identifies the plugin that owns this {@link FieldRendererFactory}.
 *      When two {@link Plugin}s try to call this method, this allows XJC
 *      to report it as a user-friendly error message.
 *
 * @throws BadCommandLineException
 *      If a conflit happens, this exception carries a user-friendly error
 *      message, indicating a conflict.
 */
public void setFieldRendererFactory(FieldRendererFactory frf, Plugin owner) throws BadCommandLineException {
    // since this method is for plugins, make it bit more fool-proof than usual
    if(frf==null)
        throw new IllegalArgumentException();
    if(fieldRendererFactoryOwner!=null) {
        throw new BadCommandLineException(
            Messages.format(Messages.FIELD_RENDERER_CONFLICT,
                fieldRendererFactoryOwner.getOptionName(),
                owner.getOptionName() ));
    }
    this.fieldRendererFactoryOwner = owner;
    this.fieldRendererFactory = frf;
}
 
Example #30
Source File: Options.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the {@link FieldRendererFactory}.
 *
 * <p>
 * This method is for plugins to call to set a custom {@link FieldRendererFactory}.
 *
 * @param frf
 *      The {@link FieldRendererFactory} to be installed. Must not be null.
 * @param owner
 *      Identifies the plugin that owns this {@link FieldRendererFactory}.
 *      When two {@link Plugin}s try to call this method, this allows XJC
 *      to report it as a user-friendly error message.
 *
 * @throws BadCommandLineException
 *      If a conflit happens, this exception carries a user-friendly error
 *      message, indicating a conflict.
 */
public void setFieldRendererFactory(FieldRendererFactory frf, Plugin owner) throws BadCommandLineException {
    // since this method is for plugins, make it bit more fool-proof than usual
    if(frf==null)
        throw new IllegalArgumentException();
    if(fieldRendererFactoryOwner!=null) {
        throw new BadCommandLineException(
            Messages.format(Messages.FIELD_RENDERER_CONFLICT,
                fieldRendererFactoryOwner.getOptionName(),
                owner.getOptionName() ));
    }
    this.fieldRendererFactoryOwner = owner;
    this.fieldRendererFactory = frf;
}