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

How to use
Link
in
org.apache.polygene.library.rest.common.link

Best Java code snippets using org.apache.polygene.library.rest.common.link.Link (Showing top 14 results out of 315)

origin: apache/attic-polygene-java

HandlerCommand query( Link link, Object queryRequest, ResponseHandler handler, ResponseHandler processingErrorHandler )
{
  if (handler == null)
    handler = queryHandlers.get( link.rel().get() );
  if (handler == null)
    throw new IllegalArgumentException( "No handler set for relation "+link.rel().get() );
  if (processingErrorHandler == null)
    processingErrorHandler = processingErrorHandlers.get( link.rel().get() );
  Reference linkRef = new Reference(link.href().get());
  if (linkRef.isRelative())
    linkRef = new Reference( reference.toUri().toString() + link.href().get() );
  return invokeQuery( linkRef, queryRequest, handler, processingErrorHandler );
}
origin: apache/attic-polygene-java

public static Predicate<Link> withClass(final String clazz)
{
 return link -> {
   String classes = link.classes().get();
   return classes != null && classes.contains( clazz );
 };
}
origin: apache/attic-polygene-java

public static Predicate<Link> withId(final String id)
{
 return link -> link.id().get().equals( id);
}
origin: apache/attic-polygene-java

public T addLink( String description, String id, String rel, String href, String classes )
{
  linkBuilder.prototype().text().set( description );
  linkBuilder.prototype().id().set( id );
  linkBuilder.prototype().rel().set( rel );
  linkBuilder.prototype().href().set( href );
  linkBuilder.prototype().classes().set( classes );
  addLink( linkBuilder.newInstance() );
  return (T) this;
}
origin: apache/attic-polygene-java

public synchronized ContextResourceClient newClient( Link link )
{
  if( link == null )
  {
    throw new NullPointerException( "No link specified" );
  }
  return newClient( link.href().get() );
}
origin: apache/attic-polygene-java

  public static Function<Link, String> toRel()
  {
   return link -> link.rel().get();
  }
}
origin: apache/attic-polygene-java

public static Predicate<Link> withText(final String text)
{
 return link -> link.text().get().equals( text);
}
origin: apache/attic-polygene-java

public T addLink( String description, String id )
{
  try
  {
    linkBuilder.prototype().text().set( description );
    linkBuilder.prototype().id().set( id );
    if( command != null )
    {
      linkBuilder.prototype().href().set( command + "?entity=" + id );
    }
    else
    {
      linkBuilder.prototype()
        .href()
        .set( ( path == null ? "" : path + "/" ) + URLEncoder.encode( id, "UTF-8" ) + "/" );
    }
    linkBuilder.prototype().rel().set( rel );
    linkBuilder.prototype().classes().set( classes );
    addLink( linkBuilder.newInstance() );
    return (T) this;
  }
  catch( UnsupportedEncodingException e )
  {
    e.printStackTrace();
    return (T) this;
  }
}
origin: apache/attic-polygene-java

Reference reference = new Reference( response.getRequest().getResourceRef(), link.href().get() );
response.setLocationRef( reference );
return true;
origin: apache/attic-polygene-java

public static Predicate<Link> withRel(final String rel)
{
 return link -> link.rel().get().equals( rel);
}
origin: org.apache.polygene.libraries/org.apache.polygene.library.rest-server

prototype.classes().set( "query" );
prototype.text().set( humanReadable( query.getName() ) );
prototype.href().set( query.getName().toLowerCase() );
prototype.rel().set( query.getName().toLowerCase() );
prototype.id().set( query.getName().toLowerCase() );
queriesProperty.add( linkBuilder.newInstance() );
prototype.classes().set( "command" );
prototype.text().set( humanReadable( command.getName() ) );
prototype.href().set( command.getName().toLowerCase() );
prototype.rel().set( command.getName().toLowerCase() );
prototype.id().set( command.getName().toLowerCase() );
commandsProperty.add( linkBuilder.newInstance() );
prototype.classes().set( "resource" );
prototype.text().set( humanReadable( subResource.getName() ) );
prototype.href().set( subResource.getName().toLowerCase() + "/" );
prototype.rel().set( subResource.getName().toLowerCase() );
prototype.id().set( subResource.getName().toLowerCase() );
resourcesProperty.add( linkBuilder.newInstance() );
origin: apache/attic-polygene-java

HandlerCommand command( Link link, Object commandRequest, ResponseHandler handler, ResponseHandler processingErrorHandler )
{
  if (handler == null)
    handler = commandHandlers.get( link.rel().get() );
  if (processingErrorHandler == null)
    processingErrorHandler = processingErrorHandlers.get( link.rel().get() );
  // Check if we should do POST or PUT
  Method method;
  if( LinksUtil.withClass( "idempotent" ).test( link ) )
  {
    method = Method.PUT;
  }
  else
  {
    method = Method.POST;
  }
  Reference ref = new Reference( reference.toUri().toString() + link.href().get() );
  return invokeCommand( ref, method, commandRequest, handler, processingErrorHandler );
}
origin: org.apache.polygene.libraries/org.apache.polygene.library.rest-server

Reference reference = new Reference( response.getRequest().getResourceRef(), link.href().get() );
response.setLocationRef( reference );
return true;
origin: apache/attic-polygene-java

prototype.classes().set( "query" );
prototype.text().set( humanReadable( query.getName() ) );
prototype.href().set( query.getName().toLowerCase() );
prototype.rel().set( query.getName().toLowerCase() );
prototype.id().set( query.getName().toLowerCase() );
queriesProperty.add( linkBuilder.newInstance() );
prototype.classes().set( "command" );
prototype.text().set( humanReadable( command.getName() ) );
prototype.href().set( command.getName().toLowerCase() );
prototype.rel().set( command.getName().toLowerCase() );
prototype.id().set( command.getName().toLowerCase() );
commandsProperty.add( linkBuilder.newInstance() );
prototype.classes().set( "resource" );
prototype.text().set( humanReadable( subResource.getName() ) );
prototype.href().set( subResource.getName().toLowerCase() + "/" );
prototype.rel().set( subResource.getName().toLowerCase() );
prototype.id().set( subResource.getName().toLowerCase() );
resourcesProperty.add( linkBuilder.newInstance() );
org.apache.polygene.library.rest.common.linkLink

Javadoc

Link value

Most used methods

  • href
  • rel
  • classes
  • id
  • text

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • setScale (BigDecimal)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Github Copilot alternatives
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