/eclipse/portal/plugins/com.liferay.ide.eclipse.hook.core/src/com/liferay/ide/eclipse/hook/core/model/IService.java

https://github.com/juanferrub/liferay-ide · Java · 71 lines · 37 code · 13 blank · 21 comment · 0 complexity · c06d88f45ace2c2257e87cb3c02df1da MD5 · raw file

  1. /*******************************************************************************
  2. * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. *
  14. * Contributors:
  15. * Kamesh Sampath - initial implementation
  16. *******************************************************************************/
  17. package com.liferay.ide.eclipse.hook.core.model;
  18. import org.eclipse.sapphire.java.JavaType;
  19. import org.eclipse.sapphire.java.JavaTypeConstraint;
  20. import org.eclipse.sapphire.java.JavaTypeKind;
  21. import org.eclipse.sapphire.java.JavaTypeName;
  22. import org.eclipse.sapphire.modeling.IModelElement;
  23. import org.eclipse.sapphire.modeling.ModelElementType;
  24. import org.eclipse.sapphire.modeling.ReferenceValue;
  25. import org.eclipse.sapphire.modeling.Value;
  26. import org.eclipse.sapphire.modeling.ValueProperty;
  27. import org.eclipse.sapphire.modeling.annotations.GenerateImpl;
  28. import org.eclipse.sapphire.modeling.annotations.Label;
  29. import org.eclipse.sapphire.modeling.annotations.MustExist;
  30. import org.eclipse.sapphire.modeling.annotations.Reference;
  31. import org.eclipse.sapphire.modeling.annotations.Required;
  32. import org.eclipse.sapphire.modeling.annotations.Type;
  33. import org.eclipse.sapphire.modeling.xml.annotations.XmlBinding;
  34. /**
  35. * @author <a href="mailto:kamesh.sampath@hotmail.com">Kamesh Sampath</a>
  36. */
  37. @GenerateImpl
  38. public interface IService extends IModelElement {
  39. ModelElementType TYPE = new ModelElementType( IService.class );
  40. // *** ServiceType ***
  41. @Label( standard = "Service Type" )
  42. @XmlBinding( path = "service-type" )
  43. ValueProperty PROP_SERVICE_TYPE = new ValueProperty( TYPE, "ServiceType" );
  44. Value<String> getServiceType();
  45. void setServiceType( String value );
  46. // *** ServiceImpl ***
  47. @Type( base = JavaTypeName.class )
  48. @Reference( target = JavaType.class )
  49. @Label( standard = "Service Implementation" )
  50. @JavaTypeConstraint( kind = { JavaTypeKind.CLASS, JavaTypeKind.ABSTRACT_CLASS }, type = { "java.lang.Object" } )
  51. @MustExist
  52. @Required
  53. @XmlBinding( path = "service-impl" )
  54. ValueProperty PROP_SERVICE_IMPL = new ValueProperty( TYPE, "ServiceImpl" );
  55. ReferenceValue<JavaTypeName, JavaType> getServiceImpl();
  56. void setServiceImpl( String value );
  57. void setServiceImpl( JavaTypeName value );
  58. }