org.uddi.api_v3.Address.getAddressLine()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(10.0k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.uddi.api_v3.Address.getAddressLine()方法的一些代码示例,展示了Address.getAddressLine()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.getAddressLine()方法的具体详情如下:
包路径:org.uddi.api_v3.Address
类名称:Address
方法名:getAddressLine

Address.getAddressLine介绍

[英]Gets the value of the addressLine property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the addressLine property.

For example, to add a new item, do as follows:

getAddressLine().add(newItem);

Objects of the following type(s) are allowed in the list AddressLine
[中]获取addressLine属性的值。
此访问器方法返回对活动列表的引用,而不是快照。因此,对返回列表所做的任何修改都将出现在JAXB对象中。这就是为什么addressLine属性没有set方法的原因。
例如,要添加新项目,请执行以下操作:

getAddressLine().add(newItem);

列表地址行中允许以下类型的对象

代码示例

代码示例来源:origin: stackoverflow.com

private String getCompleteAddressString(double LATITUDE, double LONGITUDE) {
     String strAdd = "";
     Geocoder geocoder = new Geocoder(this, Locale.getDefault());
     try {
       List<Address> addresses = geocoder.getFromLocation(LATITUDE, LONGITUDE, 1);
       if (addresses != null) {
         Address returnedAddress = addresses.get(0);
         StringBuilder strReturnedAddress = new StringBuilder("");
         for (int i = 0; i < returnedAddress.getMaxAddressLineIndex(); i++) {
           strReturnedAddress.append(returnedAddress.getAddressLine(i)).append("\n");
         }
         strAdd = strReturnedAddress.toString();
         Log.w("My Current loction address", "" + strReturnedAddress.toString());
       } else {
         Log.w("My Current loction address", "No Address returned!");
       }
     } catch (Exception e) {
       e.printStackTrace();
       Log.w("My Current loction address", "Canont get Address!");
     }
     return strAdd;
   }

代码示例来源:origin: stackoverflow.com

Address address = list.get(0);
result = address.getAddressLine(0) + ", " + address.getLocality();

代码示例来源:origin: stackoverflow.com

try 
 {
  List<Address> addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 10); //<10>
  for (Address address : addresses) {
    this.locationText.append("\n" + address.getAddressLine(0));
 }
 .... 
} catch (IOException e) {
 Log.e("LocateMe", "Could not get Geocoder data", e);
}

代码示例来源:origin: stackoverflow.com

RetrofitRest.getClient().getLogin("your text", obj, new Callback<Data>() {
     @Override
     public void success(Data data, Response response) {
       SearchResult searchResult = data.getSearchResult();
       if (searchResult != null) {
         Address address = searchResult.getAddress();
         if (address != null && address.getAddressLine() != null) {
           for (AddressLine addressLine : address.getAddressLine()) {
             Log.d("TAG", "addressLine" + addressLine);
           }
         }
       }
     }
   });

代码示例来源:origin: stackoverflow.com

Geocoder myLocation = new Geocoder(yourContext, Locale.getDefault());
List<Address> myList = myLocation.getFromLocation(Double.parseDouble(latitude),Double.parseDouble(longitude), 1);
Address address = (Address) myList.get(0);
String addressStr = "";
addressStr += address.getAddressLine(0) + ", ";
addressStr += address.getAddressLine(1) + ", ";
addressStr += address.getAddressLine(2);

代码示例来源:origin: stackoverflow.com

public static String reverseGeoCoder(Context mContext,double lat,double longi){
  try{
    Geocoder geoCoder = new Geocoder(mContext);
    List<Address> matches = geoCoder.getFromLocation(lat, longi, 1);
    Address bestMatch = (matches.isEmpty() ? null : matches.get(0));
    String address = bestMatch.getAddressLine(0)+" "+bestMatch.getAddressLine(1);
    return address;
  }
  catch(Exception e){
    e.printStackTrace();
  }
  return "";
}

代码示例来源:origin: stackoverflow.com

private String getUSStateCode(Address USAddress){
  String fullAddress = "";
  for(int j = 0; j <= USAddress.getMaxAddressLineIndex(); j++)
    if (USAddress.getAddressLine(j) != null)
      fullAddress = fullAddress + " " + USAddress.getAddressLine(j);

  String stateCode = null;
  Pattern pattern = Pattern.compile(" [A-Z]{2} ");
  String helper = fullAddress.toUpperCase().substring(0, fullAddress.toUpperCase().indexOf("USA"));
  Matcher matcher = pattern.matcher(helper);
  while (matcher.find())
    stateCode = matcher.group().trim();

  return stateCode;
}

代码示例来源:origin: stackoverflow.com

Address ad = list.get(0); // Position 0 is the most specific to the coordinates.
String buff = new String(); 
for(int i = 0; i <= ad.getMaxAddressLineIndex(); i++ ) {
  buff += ad.getAddressLine(i); // for a good addres(with street name u should get getMaxAddressLineIndex() = 2
}

代码示例来源:origin: stackoverflow.com

public void getLocation(double lat, double lng) {
  Geocoder geocoder = new Geocoder(MapsActivity.this, Locale.getDefault());       

  try {
    List<Address> addresses = geocoder.getFromLocation(lat, lng, 1);
    Address obj = addresses.get(0);
    String add = obj.getAddressLine(0);           

    Log.e("IGA", "Address" + add);

  } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
  }

}

代码示例来源:origin: stackoverflow.com

Geocoder geocoder = new Geocoder(context, Locale.getDefault());
String result = null;
try {
  List<Address> addressList = geocoder.getFromLocation(
  latitude, longitude, 1);
  if (addressList != null && addressList.size() > 0) 
  {
    Address address = addressList.get(0);
    StringBuilder sb = new StringBuilder();
    // House no and street name
    sb.append(address.getAddressLine(0)).append(""); 
  }
}

代码示例来源:origin: stackoverflow.com

Geocoder gc = new Geocoder(ctx, Locale.getDefault());
List<Address> addresses;
addresses = gc.getFromLocation(lat, lng, 1);        
StringBuilder sb = new StringBuilder();
if (addresses.size() > 0) 
{
  Address address = addresses.get(0);
  for (int i = 0; i < address.getMaxAddressLineIndex(); i++)
     sb.append(address.getAddressLine(i)).append(",");
}

代码示例来源:origin: stackoverflow.com

String street = null;
Geocoder geocoder = new Geocoder(getActivity(), Locale.getDefault());
try {
   List<Address> addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);
   if (addresses != null) {
        Address returnedAddress = addresses.get(0);
        StringBuilder strReturnedAddress = new StringBuilder();
        for (int j = 0; j < returnedAddress.getMaxAddressLineIndex(); j++) {
          strReturnedAddress.append(returnedAddress.getAddressLine(j)).append("");
        }
        street = strReturnedAddress.toString();
      }
 } catch (IOException e) {
}

代码示例来源:origin: stackoverflow.com

List<Address> addresses = geocoder.getFromLocation(LATITUDE, LONGITUDE, 1);

if(addresses != null) {
Address returnedAddress = addresses.get(0);
StringBuilder strReturnedAddress = new StringBuilder("Address:\n");
for(int i=0; i<returnedAddress.getMaxAddressLineIndex(); i++) {
strReturnedAddress.append(returnedAddress.getAddressLine(i)).append("\n");
strReturnedAddress.append(returnedAddress.getLocality()).append("\n");
strReturnedAddress.append(areturnedAddress.getPostalCode()).append("\n");
strReturnedAddress.append(returnedAddress.getCountryName()).append("\n");

}
myAddress.setText(strReturnedAddress.toString());

代码示例来源:origin: stackoverflow.com

Geocoder geocoder = new Geocoder(context, Locale.getDefault());   
 String result = null;
 try {
   List<Address> list = geocoder.getFromLocation(
       location.getLatitude(), location.getLongitude(), 1);
   if (list != null && list.size() > 0) {
     Address address = list.get(0);
     // sending back first address line and locality
     result = address.getAddressLine(0) + ", " + address.getLocality();
   }
 } catch (IOException e) {
   Log.e(TAG, "Impossible to connect to Geocoder", e);
 }

代码示例来源:origin: stackoverflow.com

Geocoder gc = new Geocoder(this, Locale.getDefault()); 
 try { 
  List<Address> addresses = gc.getFromLocation(lat, lng, 1); 
  StringBuilder sb = new StringBuilder(); 
  if (addresses.size() > 0) { 
   Address address = addresses.get(0); 
   for (int i = 0; i < address.getMaxAddressLineIndex(); i++) 
    String addr=address.getAddressLine(i); 
    //use this addr string and compare . u will get the solution
  } 
 } catch (IOException e) {}

代码示例来源:origin: stackoverflow.com

Geocoder myLocation = new Geocoder(context, Locale.ENGLISH);
List<Address> myList= myLocation.getFromLocation(lat, lng, 1);
Address add = myList.get(0);
String addressString = add.getAddressLine(0);
String country = add.getCountryName();                      
String city = add.getLocality();

代码示例来源:origin: stackoverflow.com

Geocoder geocoder = new Geocoder(context, Locale.getDefault());
Address address = geocoder.getFromLocation(lat, lng, 1);
Address obj = addresses.get(0);
latLng = new LatLng(obj.getLatitude(), obj.getLongitude());
final String addressText = String.format("%s, %s",obj.getMaxAddressLineIndex() > 0 ? obj.getAddressLine(0) : "",
              obj.getCountryName());

代码示例来源:origin: stackoverflow.com

Address address = (Address) gotAddresses.get(0);

LatLng latLng = new LatLng(address.getLatitude(), address.getLongitude());

String properAddress = String.format("%s, %s",
address.getMaxAddressLineIndex() > 0 ? address.getAddressLine(0) : "",
address.getCountryName());

mMap.addMarker(new MarkerOptions()
      .position(new LatLng(address.getLatitude(), address.getLongitude())).draggable(true)
      .title(properAddress)
      .icon(BitmapDescriptorFactory.fromResource(R.drawable.pin)));

代码示例来源:origin: org.apache.juddi/juddi-core

public static void mapContactAddresses(List<org.apache.juddi.model.Address> modelAddressList,
   List<org.uddi.api_v3.Address> apiAddressList)
   throws DispositionReportFaultMessage {
    apiAddressList.clear();
    for (org.apache.juddi.model.Address modelAddress : modelAddressList) {
        org.uddi.api_v3.Address apiAddress = new org.uddi.api_v3.Address();
        apiAddress.setUseType(modelAddress.getUseType());
        apiAddress.setLang("");
        apiAddress.setSortCode(modelAddress.getSortCode());
        apiAddress.setTModelKey(modelAddress.getTmodelKey());
        mapAddressLines(modelAddress.getAddressLines(), apiAddress.getAddressLine());
        apiAddressList.add(apiAddress);
    }
}

代码示例来源:origin: org.apache.juddi/juddi-core-openjpa

public static void mapContactAddresses(List<org.apache.juddi.model.Address> modelAddressList,
   List<org.uddi.api_v3.Address> apiAddressList)
   throws DispositionReportFaultMessage {
    apiAddressList.clear();
    for (org.apache.juddi.model.Address modelAddress : modelAddressList) {
        org.uddi.api_v3.Address apiAddress = new org.uddi.api_v3.Address();
        apiAddress.setUseType(modelAddress.getUseType());
        apiAddress.setLang("");
        apiAddress.setSortCode(modelAddress.getSortCode());
        apiAddress.setTModelKey(modelAddress.getTmodelKey());
        mapAddressLines(modelAddress.getAddressLines(), apiAddress.getAddressLine());
        apiAddressList.add(apiAddress);
    }
}

相关文章