복합

2013-02-26 2 views
0

에서 사용자 정의 데이터 유형 목록을 통과 나는 두 가지 방법복합

  • 공공 무효 intItem (목록 데이터 목록) // 기본 데이터 유형을
  • 공공 무효 vipInfoDataList를 취할 수 있습니다 (목록 데이터 목록을 가지고있는 복합을 만들어) // 같은 사용자 정의 데이터 형식을 취할 수 있습니다 PlxVipInfo를

[참고 : 나는 복합 클래스의 복합 전단 폴더 및 수입에서 "PlxVipInfo"데이터 유형 정의] 다음 내가 단지로 복합을 내 protlet에 넣어 .

List<Integer> myCoords = new ArrayList<Integer>(); 
myCoords.add(10); 
myCoords.add(20); 

CommonWidget mycomposite = new CommonWidget(); 
//mycomposite.intItem(myCoords);[**Note: when i call it gives data**] 
mycomposite.vipInfoDataList(vips);[**Note: when i call it gives error**] 

오류는 다음과 같습니다 :

지금
compile-java: 
[javac] Compiling 1 source file to /home/bglobal/liferay-sdk/portlets/customer-common-gridview-portlet/docroot/WEB-INF/classes 
[javac] /home/bglobal/liferay-sdk/portlets/customer-common-gridview-portlet/docroot/WEB-INF/src/com/prolexic/portlet/proxy/client/PlxProxyServiceEntryPoint.java:174: vipInfoDataList(java.util.List<com.prolexic.composite.shared.PlxVipInfo>) in com.prolexic.composite.client.CommonWidget cannot be applied to (java.util.List<com.prolexic.portlet.proxy.shared.PlxVipInfo>) 
[javac]      mycomposite.vipInfoDataList(vips); 
[javac]        ^
[javac] Note: /home/bglobal/liferay-sdk/portlets/customer-common-gridview-portlet/docroot/WEB-INF/src/com/prolexic/portlet/proxy/client/PlxProxyServiceEntryPoint.java uses or overrides a deprecated API. 
[javac] Note: Recompile with -Xlint:deprecation for details. 
[javac] 1 error 

어떻게해야합니까 는이 두 메서드를 호출?

답변

0

ERROR 분명히 말하지만, 사용자 정의 유형은 PlxVipInfo passing through vipInfoDataList() method and the one declared are diffrent입니다.

이들은 2 개의 다른 클래스이며 하나는 com.prolexic.composite.shared 패키지에 있고 다른 하나는 com.prolexic.portlet.proxy.shared입니다.

그래서, 두 곳 모두에서 코드 snippet-

아래와 같은 방법을 사용하는 동일한 유형 com.prolexic.composite.shared.PlxVipInfo 또는 com.prolexic.portlet.proxy.shared.PlxVipInfo 중 하나를 인수로 전달하고 선언하면서
vipInfoDataList(java.util.List<com.prolexic.composite.shared.PlxVipInfo>); 

public void vipInfoDataList(java.util.List<com.prolexic.composite.shared.PlxVipInfo>) 
{ 
} 

또는

vipInfoDataList(java.util.List<com.prolexic.portlet.proxy.shared.PlxVipInfo>); 

public void vipInfoDataList(java.util.List<com.prolexic.portlet.proxy.shared.PlxVipInfo>) 
{ 
}