Tabnine Logo
ServiceId
Code IndexAdd Tabnine to your IDE (free)

How to use
ServiceId
in
org.apache.tapestry5.ioc.annotations

Best Java code snippets using org.apache.tapestry5.ioc.annotations.ServiceId (Showing top 5 results out of 315)

origin: spockframework/spock

@ServiceId("Service3")
public class Service3 implements IService3 {
 private final IService2 service2;

 public Service3(IService2 service2) {
  this.service2 = service2;
 }

 public String generateString() {
  return service2.generateQuickBrownFox();
 }
}

origin: org.apache.tapestry/tapestry-ioc

/**
 * Extracts the service id from the passed annotated element. First the {@link ServiceId} annotation is checked.
 * If present, its value is returned. Otherwise {@link Named} annotation is checked. If present, its value is
 * returned.
 * If neither of the annotations is present, <code>null</code> value is returned
 *
 * @param annotated
 *         annotated element to get annotations from
 * @since 5.3
 */
public static String getServiceId(AnnotatedElement annotated)
{
  ServiceId serviceIdAnnotation = annotated.getAnnotation(ServiceId.class);
  if (serviceIdAnnotation != null)
  {
    return serviceIdAnnotation.value();
  }
  Named namedAnnotation = annotated.getAnnotation(Named.class);
  if (namedAnnotation != null)
  {
    String value = namedAnnotation.value();
    if (InternalCommonsUtils.isNonBlank(value))
    {
      return value;
    }
  }
  return null;
}
origin: apache/tapestry-5

/**
 * Extracts the service id from the passed annotated element. First the {@link ServiceId} annotation is checked.
 * If present, its value is returned. Otherwise {@link Named} annotation is checked. If present, its value is
 * returned.
 * If neither of the annotations is present, <code>null</code> value is returned
 *
 * @param annotated
 *         annotated element to get annotations from
 * @since 5.3
 */
public static String getServiceId(AnnotatedElement annotated)
{
  ServiceId serviceIdAnnotation = annotated.getAnnotation(ServiceId.class);
  if (serviceIdAnnotation != null)
  {
    return serviceIdAnnotation.value();
  }
  Named namedAnnotation = annotated.getAnnotation(Named.class);
  if (namedAnnotation != null)
  {
    String value = namedAnnotation.value();
    if (InternalCommonsUtils.isNonBlank(value))
    {
      return value;
    }
  }
  return null;
}
origin: apache/tapestry-5

@ServiceId("BarneyService")
public class ServiceIdViaAnnotationServiceImpl implements Runnable
{

  @Override
  public void run()
  {
  }

}

origin: apache/tapestry-5

@ServiceId("FooService")
public static Runnable buildSomething()
{
  return new ServiceIdViaMethodAnnotationServiceImpl();
}
org.apache.tapestry5.ioc.annotationsServiceId

Most used methods

  • <init>
  • value

Popular in Java

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Join (org.hibernate.mapping)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now