Define the getter.

 Usage:

   attacher.getters
169373
def getters
      name = @name
      options = @options
      @klass.send(:define_method, name) do
        ivar = :"@_attachment_#{name}"
        attachment = instance_variable_get(ivar)

        if attachment.nil?
          attachment = Attachment.new(name, self, options)
          instance_variable_set(ivar, attachment)
        end

        return attachment
      end
    end
450220
def parse_attachments(self, node):
        

        if 'name' in node.lattrib:
            name = node.lattrib['name']
        else:
            self.raise_error('<Attachments> must specify a name.')

        if 'type' in node.lattrib:
            type_ = node.lattrib['type']
        else:
            self.raise_error("Attachment '{0}' must specify a type.",
                             name)

        description = node.lattrib.get('description', '')
        self.current_component_type.add_attachments(Attachments(name, type_, description))
813945
function getGetterSetter(object, name, kind) {
  if (hasProperty(object, name)) {
    const descriptor = descriptorOf(object, name);
    return descriptor[kind] ?  Maybe.Just(descriptor[kind])
    :      /* otherwise */     Maybe.Nothing();
  } else {
    return Maybe.Nothing();
  }
}
604346
public function accessorRelation(callable $getter, callable $setter): RelationUsingDefiner
    {
        return $this->defineRelationVia(new CustomAccessor($getter, $setter), function () {
            $this->verifyAllPropertiesMapped = false;
        });
    }
726596
def define_finder(finder_name)
      class_eval <<-end_eval
        def self.find_all_by_#{finder_name}(user_query, options={})
          options[:fields] ||= index_views_hash[:default]

          # quote the query if the field type is :string
          if finder_field = index_field(:#{finder_name})
            ([:string, :string_array].member?(finder_field.field_type)) ?
              query = "#{finder_name}:(\\"\#{user_query}\\")" : query = "#{finder_name}:(\#{user_query})"
          else
            query = user_query
          end

          if options[:format] == :ids
            index_adapter.find_ids_by_index(self, query, options)
          else
            index_adapter.find_by_index(self, query, options)
          end
        end

        def self.find_by_#{finder_name}(user_query, options={})
          find_all_by_#{finder_name}(user_query, options.merge({:limit => 1})).first
        end
      end_eval
    end
313175
function( bindingPoint, res ){
    var attachment = new Attachment( res );
    bindingPoint = 0|bindingPoint;

    this.detach( bindingPoint );

    this.attachments[bindingPoint.toString()] = attachment;
    this.attachmentsList.push( attachment );

    attachment._resize( this.width, this.height );
    attachment._attach( bindingPoint );
    return attachment;
  }
688066
protected void lookupGetters(final Map<String, Property> properties, final MethodHolder<?> clazz)
   {
      // Hack until https://issues.jboss.org/browse/FORGE-368

      for (Method<?, ?> method : clazz.getMethods())
      {
         // Exclude static methods

         if (method.isStatic())
         {
            continue;
         }

         // Exclude non-public methods. Section 8.3.1 of the JavaBean specification requires that getters be public.
         if (!method.isPublic())
         {
            continue;
         }

         // Get type

         if (!method.getParameters().isEmpty())
         {
            continue;
         }

         String returnType = method.getReturnType() != null ? method.getReturnType().getQualifiedName() : null;

         if (returnType == null)
         {
            continue;
         }

         // Get name

         String propertyName = isGetter(method);

         if (propertyName == null)
         {
            continue;
         }

         Field<?> privateField = getPrivateField((FieldHolder<?>) clazz, propertyName);

         if (privateField != null && this.privateFieldConvention == null)
         {
            propertyName = privateField.getName();
         }

         properties
                  .put(propertyName,
                           new ForgeProperty(propertyName, returnType, method, null, privateField, this.project));
      }
   }
356352
function (scope, key, getter) {
      var value = null, args = Array.prototype.slice.call(arguments);
      var params = (args.length > 3) ? args.slice(3) : [];

      Object.defineProperty(scope, key, {
        get: function () {
          if (value === null) value = getter.apply(scope, params);
          return value;
        }
      });
    }
510616
def get(self, obj, **kwargs):
        
        assert self.getter is not None, "Getter accessor is not specified."
        if callable(self.getter):
            return self.getter(obj, **_get_context(self._getter_argspec, kwargs))

        assert isinstance(self.getter, string_types), "Accessor must be a function or a dot-separated string."

        for attr in self.getter.split("."):
            if isinstance(obj, dict):
                obj = obj[attr]
            else:
                obj = getattr(obj, attr)

        if callable(obj):
            return obj()

        return obj
619973
def attribute(getter):
    
    if isfunction(getter):
        def setter(self, value):
            name = '_' + getter.__name__
            self.__change_attribute__(name=name, value=value)

        def new_getter(self):
            name = '_' + getter.__name__
            return getattr(self, name, None)

        return property(fget=new_getter, fset=setter, doc=getter.__doc__)
    else:
        raise ProgrammingError("Expected a function, got: {}".format(repr(getter)))
1162965
function Property(path, node, scope, getObjectRef, file) {
  if (!node.method && node.kind === "init") return;
  if (!t.isFunction(node.value)) return;

  var replaceSupers = new _helpersReplaceSupers2["default"]({
    getObjectRef: getObjectRef,
    methodNode: node,
    methodPath: path,
    isStatic: true,
    scope: scope,
    file: file
  });

  replaceSupers.replace();
}
869220
function createGettersAndSetters() {
        var editor = EditorManager.getActiveEditor();
        if (!editor) {
            return;
        }
        initializeRefactoringSession(editor);

        var startIndex = current.startIndex,
            endIndex = current.endIndex,
            selectedText = current.selectedText;

        if (selectedText.length >= 1) {
            var selectionDetails = RefactoringUtils.normalizeText(selectedText, startIndex, endIndex);
            selectedText = selectionDetails.text;
            startIndex = selectionDetails.start;
            endIndex = selectionDetails.end;
        }

        var token = TokenUtils.getTokenAt(current.cm, current.cm.posFromIndex(endIndex)),
            commaString = ",",
            isLastNode,
            templateParams,
            parentNode,
            propertyEndPos;

        //Create getters and setters only if selected reference is a property
        if (token.type !== "property") {
            current.editor.displayErrorMessageAtCursor(Strings.ERROR_GETTERS_SETTERS);
            return;
        }

        parentNode = current.getParentNode(current.ast, endIndex);
        // Check if selected propery is child of a object expression
        if (!parentNode || !parentNode.properties) {
            current.editor.displayErrorMessageAtCursor(Strings.ERROR_GETTERS_SETTERS);
            return;
        }


        var propertyNodeArray = parentNode.properties;
        // Find the last Propery Node before endIndex
        var properyNodeIndex = propertyNodeArray.findIndex(function (element) {
            return (endIndex >= element.start && endIndex < element.end);
        });

        var propertyNode = propertyNodeArray[properyNodeIndex];

        //Get Current Selected Property End Index;
        propertyEndPos = editor.posFromIndex(propertyNode.end);


        //We have to add ',' so we need to find position of current property selected
        isLastNode = current.isLastNodeInScope(current.ast, endIndex);
        var nextPropertNode, nextPropertyStartPos;
        if(!isLastNode && properyNodeIndex + 1 <= propertyNodeArray.length - 1) {
            nextPropertNode = propertyNodeArray[properyNodeIndex + 1];
            nextPropertyStartPos = editor.posFromIndex(nextPropertNode.start);

            if(propertyEndPos.line !== nextPropertyStartPos.line) {
                propertyEndPos = current.lineEndPosition(current.startPos.line);
            } else {
                propertyEndPos = nextPropertyStartPos;
                commaString = ", ";
            }
        }

        var getSetPos;
        if (isLastNode) {
            getSetPos = current.document.adjustPosForChange(propertyEndPos, commaString.split("\n"),
                                                            propertyEndPos, propertyEndPos);
        } else {
            getSetPos = propertyEndPos;
        }
        templateParams = {
            "getName": token.string,
            "setName": token.string,
            "tokenName": token.string
        };

        // Replace, setSelection, IndentLine
        // We need to call batchOperation as indentLine don't have option to add origin as like replaceRange
        current.document.batchOperation(function() {
            if (isLastNode) {
                //Add ',' in the end of current line
                current.document.replaceRange(commaString, propertyEndPos, propertyEndPos);
            }

            current.editor.setSelection(getSetPos); //Selection on line end

            // Add getters and setters for given token using template at current cursor position
            current.replaceTextFromTemplate(GETTERS_SETTERS, templateParams);

            if (!isLastNode) {
                // Add ',' at the end setter
                current.document.replaceRange(commaString, current.editor.getSelection().start, current.editor.getSelection().start);
            }
        });
    }
1303372
function attacher(options) {
    var Parser = this.Parser;
    var proto = Parser.prototype;

    /*
     * Add a tokenizer to the `Parser`.
     */
    proto.blockTokenizers.blockquote = tokenizeAnnotatedBlockquote;

    return transformer;
}
870048
def method_missing(name, *args, &block)
      getter_name = name[0..-2]

      if name =~ /^[a-z]+=$/ && !respond_to?(getter_name)
        define_accessor(getter_name, args.first)
      else
        super
      end
    end
293418
function definePropertyHolder(object) {
                let holder = defaultValue;

                Object.defineProperty(object, id, {
                    enumerable: false,
                    configurable: true,
                    get: function getterWrapper() {
                        if (checkIfWrapped(getterWrapper.caller)) {
                            return holder;
                        }
                        throw new ReferenceError(`Access violation for private property: 
                            ${id}`);
                    },
                    set: function setterWrapper(value) {
                        if (checkIfWrapped(setterWrapper.caller)) {
                            holder = value;
                        } else {
                            throw new ReferenceError(`Access violation for private property:
                                 ${id}`);
                        }
                    }
                });
                propertyHolderDefined = true;
            }
839994
function defineGetter(index, properties) {
        // If the field type is an alias, we retrieve the value through the alias's index.
        let indexOrAliasIndex = properties.type === 'alias' ? properties.index : index;

        this.__defineGetter__(index, () => {
            // If accessing object or array, lazy initialize if not set.
            if (!this[_privateKey]._obj[indexOrAliasIndex] && (properties.type === 'object' || properties.type === 'array')) {
                // Initialize object.
                if (properties.type === 'object') {
                    if (properties.default !== undefined) {
                        writeValue.call(this[_privateKey]._this, _.isFunction(properties.default) ?
                            properties.default.call(this) :
                            properties.default, properties);
                    } else {
                        writeValue.call(this[_privateKey]._this,
                            properties.objectType ? new properties.objectType({}, this[_privateKey]._root) : {}, properties);
                    }

                    // Native arrays are not used so that Array class can be extended with custom behaviors.
                } else if (properties.type === 'array') {
                    writeValue.call(this[_privateKey]._this, new SchemaArray(this, properties), properties);
                }
            }

            try {
                return getter.call(this, this[_privateKey]._obj[indexOrAliasIndex], properties);
            } catch (error) {
                // This typically happens when the default value isn't valid -- log error.
                this[_privateKey]._errors.push(error);
            }
        });
    }
251745
Collection<Method> getRelevantGetters(Class<?> clazz) {
        synchronized (getterCache) {
            if ( !getterCache.containsKey(clazz) ) {
                List<Method> relevantGetters = new LinkedList<Method>();
                for ( Method m : clazz.getMethods() ) {
                    if ( isRelevantGetter(m) ) {
                        relevantGetters.add(m);
                    }
                }
                getterCache.put(clazz, relevantGetters);
            }
        }
        return getterCache.get(clazz);
    }