def java_package_str(java_package_pb, delimiter):
    """
    Return full string of a java package proto.
    :param JavaPackage java_package_pb: java_signatures_pb2.JavaPackage
    :param str delimiter:
    :return: str
    """
    pkg_str = java_package_pb.name
    tmp = java_package_pb
    while tmp.HasField('parent'):
        tmp = tmp.parent
        pkg_str = tmp.name + delimiter + pkg_str
    return pkg_str