Example usage for java.lang AbstractMethodError AbstractMethodError

List of usage examples for java.lang AbstractMethodError AbstractMethodError

Introduction

In this page you can find the example usage for java.lang AbstractMethodError AbstractMethodError.

Prototype

public AbstractMethodError(String s) 

Source Link

Document

Constructs an AbstractMethodError with the specified detail message.

Usage

From source file:org.jenkinsci.plugins.durabletask.FileMonitoringTask.java

/**
 * Should start a process which sends output to {@linkplain FileMonitoringController#getLogFile(FilePath) log file}
 * in the workspace and finally writes its exit code to {@linkplain FileMonitoringController#getResultFile(FilePath) result file}.
 * @param workspace the workspace to use
 * @param launcher a way to launch processes
 * @param listener build console log/*from ww w. j  av a2s .com*/
 * @param envVars recommended environment for the subprocess
 * @return a specialized controller
 */
protected FileMonitoringController doLaunch(FilePath workspace, Launcher launcher, TaskListener listener,
        EnvVars envVars) throws IOException, InterruptedException {
    throw new AbstractMethodError("override either doLaunch or launchWithCookie");
}

From source file:org.parakoopa.gmnet.tests.tests.AbstractTest.java

/**
 * Path to test project .project.gmx file
 * @return Returns the path to test project .project.gmx file
 *///  ww  w.  ja v  a2s . c  o m
static protected String getProject() {
    throw new AbstractMethodError("This static method needs to be overwritten");
}

From source file:org.pentaho.amazon.AbstractAmazonJobExecutorController.java

private static BindingConvertor<String, Boolean> accessKeyIsEmpty(XulDomContainer container) {
    return new BindingConvertor<String, Boolean>() {
        @Override/*from w  w  w  .ja v a2  s.co m*/
        public Boolean sourceToTarget(String value) {
            return disableConnectButton(container);
        }

        @Override
        public String targetToSource(Boolean value) {
            throw new AbstractMethodError("Boolean to String conversion is not supported");
        }
    };
}

From source file:org.pentaho.amazon.AbstractAmazonJobExecutorController.java

private static BindingConvertor<String, Boolean> secretKeyIsEmpty(XulDomContainer container) {
    return new BindingConvertor<String, Boolean>() {
        @Override/*from  w  w w.  j a v  a2 s .c o m*/
        public Boolean sourceToTarget(String value) {
            return disableConnectButton(container);
        }

        @Override
        public String targetToSource(Boolean value) {
            throw new AbstractMethodError("Boolean to String conversion is not supported");
        }
    };
}

From source file:org.phenotips.entities.internal.AbstractPrimaryEntityManager.java

/**
 * Gets a reference to {@link PrimaryEntity#getType() the XClass used} for the primary entities being managed. The
 * base implementation assumes that this class is annotated with a {@code Named} with its value set to a partial
 * reference to the target XClass. This name shouldn't have a wiki reference, since this depends on the current
 * instance. If the name doesn't have a space, it will be assumed to be {@code PhenoTips}. If the name doesn't end
 * with {@code Class}, it is added automatically. For example, assuming the targeted XClass is
 * {@code PhenoTips.PatientClass}, the following names are supported, in order of preference:
 * <ul>/*from w w  w. ja va2s . c  o m*/
 * <li>Patient</li>
 * <li>PhenoTips.PatientClass</li>
 * <li>PhenoTips.Patient</li>
 * <li>PatientClass</li>
 * </ul>
 * If, instead, the targeted XClass is {@code OncoTips.Family}, then only that exact name is supported.
 *
 * @return a full reference resolved in the current virtual instance
 */
protected DocumentReference getEntityXClassReference() {
    if (this.getClass().getAnnotation(Named.class) == null) {
        this.logger.error("Invalid component configuration: {} does not have a @Named annotation",
                this.getClass().getName());
        throw new AbstractMethodError("Missing @Named annotation on PrimaryEntityManager class "
                + this.getClass().getCanonicalName());
    }
    String name = this.getClass().getAnnotation(Named.class).value();
    DocumentReference result = this.stringResolver.resolve(name, Constants.CODE_SPACE_REFERENCE);
    if (!this.bridge.exists(result) && !name.endsWith("Class")) {
        result = this.stringResolver.resolve(name + "Class", Constants.CODE_SPACE_REFERENCE);
    }
    if (!this.bridge.exists(result)) {
        this.logger.error("Invalid component configuration: {} does not have a valid @Named annotation",
                this.getClass().getName());
        throw new AbstractMethodError(
                "The @Named annotation on PrimaryEntityManager class " + this.getClass().getCanonicalName()
                        + " must be a reference to the XClass used by its managed entity");
    }
    return result;
}

From source file:org.phenotips.entities.internal.AbstractPrimaryEntityManager.java

/**
 * Gets the concrete class of the managed PrimaryEntity. The base implementation assumes that the class is passed
 * for the first generic parameter.//from   w w  w.  j  av  a 2 s  .  c o m
 *
 * @return a class
 * @throws AbstractMethodError if the manager class doesn't properly define the generic parameter
 */
@SuppressWarnings("unchecked")
protected Class<? extends E> getEntityClass() {
    if (this.eclass == null) {
        Type cls = this.getClass().getGenericSuperclass();
        while (cls instanceof Class) {
            cls = ((Class<?>) cls).getGenericSuperclass();
        }
        ParameterizedType pcls = (ParameterizedType) cls;
        if (pcls.getActualTypeArguments().length == 0 || !(pcls.getActualTypeArguments()[0] instanceof Class)) {
            this.logger.error(
                    "Invalid component configuration: {} does not define a real class for the <E> parameter",
                    this.getClass().getName());
            throw new AbstractMethodError("The PrimaryEntityManager class " + this.getClass().getCanonicalName()
                    + " must define a real class for the <E> parameter");
        }
        this.eclass = (Class<E>) pcls.getActualTypeArguments()[0];
    }
    return this.eclass;
}

From source file:org.phenotips.entities.internal.AbstractPrimaryEntityManager.java

/**
 * Gets the constructor of the managed PrimaryEntity concrete class that accepts an XDocument as the only parameter.
 * Override if another constructor is needed, but keep in mind that {@link #load(DocumentModelBridge)} must also be
 * overridden to pass in the required arguments.
 *
 * @return a constructor that requires an XWikiDocument as its only parameter
 * @throws AbstractMethodError if no such constructor can be found
 *//*  w w w  .  j a v  a 2  s .  c  o  m*/
protected Constructor<? extends E> getEntityConstructor() throws AbstractMethodError {
    if (this.econstructor == null) {
        try {
            this.econstructor = getEntityClass().getConstructor(XWikiDocument.class);
        } catch (NoSuchMethodException | SecurityException e) {
            try {
                this.econstructor = getEntityClass().getConstructor(DocumentModelBridge.class);
            } catch (NoSuchMethodException | SecurityException ex) {
                this.logger.error("Cannot instantiate primary entity [{}]: {}", getEntityClass().getName(),
                        ex.getMessage());
                throw new AbstractMethodError("The PrimaryEntity class " + getEntityClass().getCanonicalName()
                        + " must have a public constructor that accepts an XWikiDocument parameter");
            }
        }
    }
    return this.econstructor;
}