Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
   * with the License.  You may obtain a copy of the License at
   *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
 package org.apache.felix.scrplugin.description;
 
 
A ReferenceDescription describes a reference from a component to another service. In general all fields should be set by an annocation scanner, no default values should be assumed for these fields:
  • name
  • interfaceName
  • target
  • cardinality
  • policy
  • policyOption
  • strategy
These values have the following default values:
  • field : null
  • bind : null
  • unbind : null
  • updated : null
 
 public class ReferenceDescription extends AbstractDescription {
 
     private String name;
     private String interfaceName;
     private String target;
     private ReferenceCardinality cardinality;
     private ReferencePolicy policy;
     private ReferenceStrategy strategy;
 
     private Field field;
 
     private String bind;
     private String unbind;
     private String updated;
 
     private boolean bindMethodCreated = false;
     private boolean unbindMethodCreated = false;
 
     public ReferenceDescription(final ScannedAnnotation annotation) {
         super(annotation);
     }
 
     public String getName() {
         return ;
     }
 
     public void setName(String name) {
         this. = name;
     }
 
     public String getInterfaceName() {
         return ;
     }
 
     public void setInterfaceName(String interfacename) {
         this. = interfacename;
     }
 
     public String getTarget() {
         return ;
     }
 
     public void setTarget(String target) {
         this. = target;
     }
 
     public ReferenceCardinality getCardinality() {
         return ;
     }
 
    public void setCardinality(ReferenceCardinality cardinality) {
        this. = cardinality;
    }
    public ReferencePolicy getPolicy() {
        return ;
    }
    public void setPolicy(ReferencePolicy policy) {
        this. = policy;
    }
        return ;
    }
    public void setPolicyOption(ReferencePolicyOption policyOption) {
        this. = policyOption;
    }
    public String getBind() {
        return ;
    }
    public void setBind(String bind) {
        this. = bind;
    }
    public String getUnbind() {
        return ;
    }
    public void setUnbind(String unbind) {
        this. = unbind;
    }
    public String getUpdated() {
        return ;
    }
    public void setUpdated(String updated) {
        this. = updated;
    }
    public ReferenceStrategy getStrategy() {
        return ;
    }
    public void setStrategy(ReferenceStrategy strategy) {
        this. = strategy;
    }
    public Field getField() {
        return ;
    }
    public void setField(Field field) {
        this. = field;
    }
    public boolean isBindMethodCreated() {
        return ;
    }
    public void setBindMethodCreated(final boolean bindMethodCreated) {
        this. = bindMethodCreated;
    }
    public boolean isUnbindMethodCreated() {
        return ;
    }
    public void setUnbindMethodCreated(final boolean unbindMethodCreated) {
        this. = unbindMethodCreated;
    }
    @Override
    public String toString() {
        return "ReferenceDescription [name=" +  + ", interfaceName="
                +  + ", target=" +  + ", cardinality="
                +  + ", policy=" +  + ", policyOption=" +  +
                "bind=" + 
                + ", unbind=" +  + ", updated=" +  + ", strategy="
                +  + ", field=" +  + ", annotation=" + 
                + "]";
    }
    @Override
    public String getIdentifier() {
        if ( this.getField() != null ) {
            return super.getIdentifier() + "(" + this.getField().getName() + ")";
        }
        return super.getIdentifier();
    }
    @Override
    public AbstractDescription clone() {
        final ReferenceDescription cd = new ReferenceDescription(this.);
        cd.setName(this.getName());
        cd.setInterfaceName(this.getInterfaceName());
        cd.setTarget(this.getTarget());
        cd.setCardinality(this.getCardinality());
        cd.setPolicy(this.getPolicy());
        cd.setPolicyOption(this.getPolicyOption());
        cd.setStrategy(this.getStrategy());
        cd.setField(this.getField());
        cd.setBind(this.getBind());
        cd.setUnbind(this.getUnbind());
        cd.setUpdated(this.getUpdated());
        cd.setBindMethodCreated(this.isBindMethodCreated());
        return cd;
    }
New to GrepCode? Check out our FAQ X