Examples of IObjectSymbol


Examples of org.eclipse.jst.jsf.context.symbol.IObjectSymbol

        Object[] factoredProperties = new Object[] {propertyId};

        // check for expected interface types per JSP.2.3.4
        if (base instanceof IObjectSymbol)
        {
            final IObjectSymbol objSymbol = (IObjectSymbol) base;
            typeDesc = objSymbol.getTypeDescriptor();

            // although not stated explicitly stated by the spec, in practice (based on Sun RI),
            // a list cannot have non-numeric indexed properties
            // note: due to remove(Object) having different return types
            // an object can't be both a List and a Map!  So we can consider
            // a List instanceof out of order
            if (objSymbol.supportsCoercion(TypeConstants.TYPE_LIST))
            {
                typeDesc = null;
            }
            // per JSP.2.3.4, if instance of map (unconstrained in our terminology)
            else if (objSymbol.supportsCoercion(TypeConstants.TYPE_MAP))
            {
                EList<ValueType>  args = new BasicEList<ValueType>();
                args.add(new StringLiteralType(propertyId.toString()));
               
                ISymbol prop = objSymbol.call("get", args, propertyId.toString()); //$NON-NLS-1$
               
                if (prop != null)
                {
                    return prop;
                }
               
                typeDesc = objSymbol.coerce(TypeConstants.TYPE_MAP);

                // handle string keys into maps that contain dots.  Because type descriptor
                // handle dotted property ids (i.e. 'x.y.z') as separate properties with
                // intermediate parts, we need to handle this specially.
                if (propertyId instanceof String && ((String)propertyId).indexOf('.')>-1)
View Full Code Here

Examples of org.eclipse.jst.jsf.context.symbol.IObjectSymbol

       
        // check for expected interface types per JSP.2.3.4
        if (base instanceof IObjectSymbol)
        {

          final IObjectSymbol objSymbol = (IObjectSymbol) base;
            typeDesc = objSymbol.getTypeDescriptor();

            // per JSP.2.3.4, if instance of array (unconstrained in our terminology)
            if (typeDesc.isArray())
            {
                ISymbol arrayElement = typeDesc.getArrayElement();
                // reset the name
                arrayElement.setName(base.getName()+"["+offset+"]"); //$NON-NLS-1$ //$NON-NLS-2$
                return arrayElement;
            }
           
            // per JSP.2.3.4, if instance of list (unbounded in our terminology)
            if (objSymbol.supportsCoercion(TypeConstants.TYPE_LIST))
            {
                //typeDesc = objSymbol.coerce(TypeConstants.TYPE_LIST);
                final EList<ValueType> args = new BasicEList<ValueType>();
                args.add(new ValueType(Signature.SIG_INT, ValueType.ASSIGNMENT_TYPE_RHS));
                return objSymbol.call("get", args, base.getName()+"["+offset+"]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            }

            return getCCAttrsSymbolIfNecessary(typeDesc);
            // check unconstrained type
//            if (typeDesc instanceof IBoundedTypeDescriptor)
View Full Code Here

Examples of org.eclipse.jst.jsf.context.symbol.IObjectSymbol

     *         given an a literal key argument
     */
    protected Diagnostic validateNamedPropertyAccessorBase(
            final IObjectSymbolBasedValueType firstArg, final LiteralType secondArg)
    {
        final IObjectSymbol curBaseSymbol = firstArg.getSymbol();

        final ISymbol nextSymbol =
            getMemberSymbol(firstArg.getSymbol(), secondArg
                    .getLiteralValueRaw());

        // if the x in x.y is an unconstrained map an it returns
        // a java.lang.Object, then return null. We can't really say
        // anything meaningful about such a property anyway.
        // TODO: do we need to refine the type descriptor on such
        // a property object to make this more precise?
        if (curBaseSymbol.supportsCoercion(TypeConstants.TYPE_MAP)
                && nextSymbol instanceof IPropertySymbol
                && TypeConstants.TYPE_JAVAOBJECT
                .equals(((IPropertySymbol) nextSymbol)
                        .getTypeDescriptor().getTypeSignature()))
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.