Package org.openquark.cal.metadata

Examples of org.openquark.cal.metadata.InstanceMethodMetadata


    /**
     * {@inheritDoc}
     */
    @Override
    void generateInstanceMethodDoc(ClassInstance classInstance, String methodName, ClassMethod classMethod, int index) {
        InstanceMethodMetadata metadata = (InstanceMethodMetadata)getMetadata(CALFeatureName.getInstanceMethodFeatureName(classInstance, methodName), getLocale());
        CALDocComment docComment = classInstance.getMethodCALDocComment(methodName);
       
        ////
        /// With an instance method, we attempt to figure out which CALDoc comment to refer to for documentation.
        /// Often it is the case that the instance method, or even the class instance, would be undocumented. In such situations,
        /// it would be beneficial to present the documentation on the class method, since after all it is a class method that
        /// ultimately ends up being used in expressions, not the instance method backing it.
        //
       
        Scope scope = null;
        String unqualifiedName = methodName;
        FunctionalAgent entityWithArgumentNames = classMethod;
        CALDocComment classMethodCALDocComment = classMethod.getCALDocComment();
        TypeExpr typeExpr = classInstance.getInstanceMethodType(methodName);
        ArgumentMetadata[] argMetadataArray = metadata.getArguments();
        String label = labelMaker.getLabel(classInstance, methodName);
       
        /// If there are no @arg blocks for the instance method's CALDoc comment, or there is no CALDoc comment for the method at
        /// all, use the CALDoc comment for the class method
        //
View Full Code Here


                CALFeatureMetadata parentFeatureMetadata = getMetadata(owner, parentAddress);
                if (parentFeatureMetadata == null) {
                    return false;
                }
               
                InstanceMethodMetadata parentMetadata = (InstanceMethodMetadata)parentFeatureMetadata;
               
                ArgumentMetadata[] arguments = parentMetadata.getArguments();
                arguments[argNum] = (ArgumentMetadata) metadata;
                parentMetadata.setArguments(arguments);
               
                return saveMetadata(owner, parentAddress, parentMetadata);
               
            } else {
                NavAddress parentAddress = address.withAllStripped();
               
                CALFeatureMetadata parentFeatureMetadata = getMetadata(owner, parentAddress);
                if (parentFeatureMetadata == null) {
                    return false;
                }
               
                FunctionalAgentMetadata parentMetadata = (FunctionalAgentMetadata)parentFeatureMetadata;
               
                ArgumentMetadata[] arguments = parentMetadata.getArguments();
                arguments[argNum] = (ArgumentMetadata) metadata;
                parentMetadata.setArguments(arguments);
               
                return saveMetadata(owner, parentAddress, parentMetadata);
            }
           
        } else if (method == NavAddress.COLLECTOR_METHOD) {
View Full Code Here

            int argNum = Integer.parseInt(address.getParameter(NavAddress.ARGUMENT_PARAMETER));
           
            if (address.getMethod() == NavAddress.INSTANCE_METHOD_METHOD) {
                NavAddress parentAddress = NavAddress.getAddress(address.toFeatureName()); // this strips out the &argument=n parameter
                CALFeatureMetadata parentFeatureMetadata = getMetadata(owner, parentAddress);
                InstanceMethodMetadata parentMetadata = (InstanceMethodMetadata)parentFeatureMetadata;
                ArgumentMetadata[] argMetadata = parentMetadata.getArguments();
                adjustArgumentNames(owner, address, argMetadata);
               
                return argMetadata[argNum].getDisplayName();
               
            } else {
                FunctionalAgentMetadata parentMetadata = (FunctionalAgentMetadata)getMetadata(owner, address.withAllStripped());
                ArgumentMetadata[] argMetadata = parentMetadata.getArguments();
                adjustArgumentNames(owner, address.withAllStripped(), argMetadata);
               
                return argMetadata[argNum].getDisplayName();
            }
           
View Full Code Here

TOP

Related Classes of org.openquark.cal.metadata.InstanceMethodMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.