private boolean appliesToElementType( IGosuAnnotation anno, ElementType elemType ) { IAnnotationInfo annotation = anno.getType().getTypeInfo().getAnnotation( JavaTypes.TARGET() ); if( annotation == null ) { return true; } Object targetValue = annotation.getFieldValue( "value" ); if( targetValue == elemType || targetValue instanceof String && targetValue.equals( elemType.name() ) ) { return true; } else if( targetValue instanceof Object[] ) { Object[] values = (Object[])targetValue; if( values == null || values.length == 0 ) { return true; } for( Object value : values ) { if( value == elemType || value.equals( elemType.name() ) ) { return true; } } } return false; }
private boolean appliesToField( IGosuAnnotation anno ) { IAnnotationInfo annotation = anno.getType().getTypeInfo().getAnnotation( JavaTypes.TARGET() ); if( annotation == null ) { return true; } Object[] values = (Object[])annotation.getFieldValue( "value" ); if( values == null || values.length == 0 ) { return true; } else { for( Object value: values ) { if( value == ElementType.FIELD || value.equals( ElementType.FIELD.name() ) ) { return true; } } } return false; }
private void resolveResponseTransformAnnotation( IType type, WsiInvocationContextImpl.WebService webservice ) { IAnnotationInfo responseTransformAnnotation = type.getTypeInfo().getAnnotation( _responseTransformType ); if ( responseTransformAnnotation != null ) { Object instance = responseTransformAnnotation.getInstance(); webservice._responseTransform = (Function1) _responseTransformType.getTypeInfo().getProperty( "Transform" ).getAccessor().getValue( instance ); } }
private void resolveRequestXmlTransformAnnotation( IType type, WsiInvocationContextImpl.WebService webservice ) { IAnnotationInfo xmlTransformAnnotation = type.getTypeInfo().getAnnotation( _requestXmlTransformType ); if ( xmlTransformAnnotation != null ) { Object instance = xmlTransformAnnotation.getInstance(); webservice._requestXmlTransform = (Function1) _requestXmlTransformType.getTypeInfo().getProperty( "Transform" ).getAccessor().getValue( instance ); } }
private void resolveRequestTransformAnnotation( IType type, WsiInvocationContextImpl.WebService webservice ) { IAnnotationInfo requestTransformAnnotation = type.getTypeInfo().getAnnotation( _requestTransformType ); if ( requestTransformAnnotation != null ) { Object instance = requestTransformAnnotation.getInstance(); webservice._requestTransform = (Function1) _requestTransformType.getTypeInfo().getProperty( "Transform" ).getAccessor().getValue( instance ); } }
private void resolveResponseXmlTransformAnnotation( IType type, WsiInvocationContextImpl.WebService webservice ) { IAnnotationInfo xmlTransformAnnotation = type.getTypeInfo().getAnnotation( _responseXmlTransformType ); if ( xmlTransformAnnotation != null ) { Object instance = xmlTransformAnnotation.getInstance(); webservice._responseXmlTransform = (Function1) _responseXmlTransformType.getTypeInfo().getProperty( "Transform" ).getAccessor().getValue( instance ); } }
private void resolveInvocationHandlerAnnotation( IType type, WsiInvocationContextImpl.WebService webservice ) { IAnnotationInfo invocationHandlerAnnotationInfo = type.getTypeInfo().getAnnotation( _wsiInvocationHandlerType ); if ( invocationHandlerAnnotationInfo != null ) { Object instance = invocationHandlerAnnotationInfo.getInstance(); webservice._invocationHandler = (DefaultWsiInvocationHandler) _wsiInvocationHandlerType.getTypeInfo().getProperty( "InvocationHandler" ).getAccessor().getValue( instance ); } else { webservice._invocationHandler = new DefaultWsiInvocationHandler(); } }
public IType getRepeatableContainer() { IType repeatable = JavaTypes.REPEATABLE(); if( getType().getTypeInfo().hasAnnotation( repeatable ) ) { IAnnotationInfo anno = getType().getTypeInfo().getAnnotation( repeatable ); Object type = anno.getFieldValue( "value" ); if( type instanceof String ) { type = TypeSystem.getByFullNameIfValid( (String)type ); } return (IType)type; } return null; } }
private static UsageModifier translateJavaElementTypeToUsageModifier( IParsedElement pe, UsageTarget targetType, IType annotationType, AnnotationUseSiteTarget target ) IAnnotationInfo targetAnnotation = annotationType.getTypeInfo().getAnnotation( TypeSystem.get( Target.class ) ); boolean bRepeatable = annotationType.getTypeInfo().hasAnnotation( JavaTypes.REPEATABLE() );
XmlParseOptions parseOptions; XmlSerializationOptions serializationOptions; IAnnotationInfo parseOptionsAnnotation = type.getTypeInfo().getAnnotation( _wsiParseOptionsAnnotationType ); if ( parseOptionsAnnotation != null ) { Object instance = parseOptionsAnnotation.getInstance(); additionalSchemaIndexes.add( XmlSchemaResourceTypeLoaderBase.findSchemaForNamespace( defaultModule, "gw.xsd.guidewire.soapheaders" ) ); IAnnotationInfo serializationOptionsAnnotation = type.getTypeInfo().getAnnotation( _wsiSerializationOptionsAnnotationType ); if ( serializationOptionsAnnotation != null ) { Object instance = serializationOptionsAnnotation.getInstance();