当前位置: 首页>>代码示例>>Java>>正文


Java Text.getValue方法代码示例

本文整理汇总了Java中com.google.appengine.api.datastore.Text.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Text.getValue方法的具体用法?Java Text.getValue怎么用?Java Text.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.appengine.api.datastore.Text的用法示例。


在下文中一共展示了Text.getValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLifeVision

import com.google.appengine.api.datastore.Text; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public String getLifeVision(String userId) {
	PersistenceManager pm = getPm();
	try {
		// "SELECT FROM " + GaeLifeVisionBean.class.getName() + " WHERE ownerId == '"+userId+"'";
		Query query=pm.newQuery(GaeLifeVisionBean.class);
		query.setFilter("ownerId == userId");
		query.declareParameters("String userId");
		LOG.log(Level.INFO,"Query: "+query);
		List<GaeLifeVisionBean> visionsList=(List<GaeLifeVisionBean>)query.execute(userId);
		LOG.log(Level.INFO,"  Result: "+visionsList.size());
		if(visionsList!=null && visionsList.size()>0) {
			Text lifeVision = visionsList.get(0).getLifeVision();
			return (lifeVision==null?null:lifeVision.getValue());
		}
	} finally {
		pm.close();
	}
	return "";
}
 
开发者ID:dvorka,项目名称:coaching-notebook,代码行数:21,代码来源:GaePersistence.java

示例2: getPageText

import com.google.appengine.api.datastore.Text; //导入方法依赖的package包/类
public String getPageText() {
    final Text text = page.getText();
    if (text != null) {
        return text.getValue();
    } else {
        return null;
    }
}
 
开发者ID:MattHeard,项目名称:Dendrite,代码行数:9,代码来源:ReadView.java

示例3: FeedbackSubmissionEditQuestion

import com.google.appengine.api.datastore.Text; //导入方法依赖的package包/类
public FeedbackSubmissionEditQuestion(FeedbackQuestionAttributes questionAttributes, int qnIndx,
                                boolean isModeratedQuestion) {

    courseId = questionAttributes.courseId;
    questionNumber = questionAttributes.questionNumber;
    this.qnIndx = qnIndx;
    questionId = questionAttributes.getId();
    questionText = questionAttributes.getQuestionDetails().getQuestionText();
    Text description = questionAttributes.getQuestionDescription();
    questionDescription = description == null ? null : description.getValue();
    instructions = questionAttributes.getQuestionDetails().getInstructions();
    visibilityMessages = questionAttributes.getVisibilityMessage();
    questionType = questionAttributes.questionType;
    numberOfEntitiesToGiveFeedbackTo = questionAttributes.numberOfEntitiesToGiveFeedbackTo;
    this.isModeratedQuestion = isModeratedQuestion;
    isRecipientNameHidden = questionAttributes.isRecipientNameHidden();
    isGiverTeam = questionAttributes.giverType.equals(FeedbackParticipantType.TEAMS);
    if (questionAttributes.recipientType.isTeam()) {
        recipientType = RecipientType.TEAM;
    } else if (questionAttributes.isRecipientAStudent()) {
        recipientType = RecipientType.STUDENT;
    } else if (questionAttributes.isRecipientInstructor()) {
        recipientType = RecipientType.INSTRUCTOR;
    }

    setMessageToDisplayIfNoRecipientAvailable(questionAttributes);

}
 
开发者ID:TEAMMATES,项目名称:teammates,代码行数:29,代码来源:FeedbackSubmissionEditQuestion.java

示例4: getTextFromComment

import com.google.appengine.api.datastore.Text; //导入方法依赖的package包/类
public String getTextFromComment(Text commentText) {
    String htmlText = commentText.getValue();
    StringBuilder comment = new StringBuilder(200);
    comment.append(Jsoup.parse(htmlText).text());
    if (!(Jsoup.parse(htmlText).getElementsByTag("img").isEmpty())) {
        comment.append("Images Link: ");
        Elements ele = Jsoup.parse(htmlText).getElementsByTag("img");
        for (Element element : ele) {
            comment.append(element.absUrl("src") + ' ');
        }
    }
    return SanitizationHelper.sanitizeForCsv(comment.toString());
}
 
开发者ID:TEAMMATES,项目名称:teammates,代码行数:14,代码来源:FeedbackSessionResultsBundle.java

示例5: sanitizeForRichText

import com.google.appengine.api.datastore.Text; //导入方法依赖的package包/类
/**
 * Sanitizes the {@link Text} with rich-text.
 * Removes disallowed elements based on defined policy.
 * @return A new sanitized {@link Text} or null if the input was null.
 */
public static Text sanitizeForRichText(Text text) {
    if (text == null || text.getValue() == null) {
        return null;
    }
    return new Text(sanitizeForRichText(text.getValue()));
}
 
开发者ID:TEAMMATES,项目名称:teammates,代码行数:12,代码来源:SanitizationHelper.java

示例6: marshal

import com.google.appengine.api.datastore.Text; //导入方法依赖的package包/类
@Override
public String marshal(Text t) {
  return (t == null) ? null : t.getValue();
}
 
开发者ID:google,项目名称:nomulus,代码行数:5,代码来源:RemoveWhitespaceTextAdapter.java

示例7: JobRecord

import com.google.appengine.api.datastore.Text; //导入方法依赖的package包/类
/**
 * Re-constitutes an instance of this class from a Data Store entity.
 *
 * @param entity
 */
public JobRecord(Entity entity) {
  super(entity);
  jobInstanceKey = (Key) entity.getProperty(JOB_INSTANCE_PROPERTY);
  finalizeBarrierKey = (Key) entity.getProperty(FINALIZE_BARRIER_PROPERTY);
  runBarrierKey = (Key) entity.getProperty(RUN_BARRIER_PROPERTY);
  outputSlotKey = (Key) entity.getProperty(OUTPUT_SLOT_PROPERTY);
  state = State.valueOf((String) entity.getProperty(STATE_PROPERTY));
  exceptionHandlingAncestorKey =
      (Key) entity.getProperty(EXCEPTION_HANDLING_ANCESTOR_KEY_PROPERTY);
  Object exceptionHandlerSpecifiedProperty =
      entity.getProperty(EXCEPTION_HANDLER_SPECIFIED_PROPERTY);
  if (null != exceptionHandlerSpecifiedProperty) {
    exceptionHandlerSpecified = (Boolean) exceptionHandlerSpecifiedProperty;
  }
  exceptionHandlerJobKey = (Key) entity.getProperty(EXCEPTION_HANDLER_JOB_KEY_PROPERTY);
  Text exceptionHandlerGraphGuidText =
      (Text) entity.getProperty(EXCEPTION_HANDLER_JOB_GRAPH_GUID_PROPERTY);
  if (null != exceptionHandlerGraphGuidText) {
    exceptionHandlerJobGraphGuid = exceptionHandlerGraphGuidText.getValue();
  }
  Object callExceptionHandlerProperty = entity.getProperty(CALL_EXCEPTION_HANDLER_PROPERTY);
  if (null != callExceptionHandlerProperty) {
    callExceptionHandler = (Boolean) callExceptionHandlerProperty;
  }
  Object ignoreExceptionProperty = entity.getProperty(IGNORE_EXCEPTION_PROPERTY);
  if (null != ignoreExceptionProperty) {
    ignoreException = (Boolean) ignoreExceptionProperty;
  }
  Text childGraphGuidText = (Text) entity.getProperty(CHILD_GRAPH_GUID_PROPERTY);
  if (null != childGraphGuidText) {
    childGraphGuid = childGraphGuidText.getValue();
  }
  exceptionKey = (Key) entity.getProperty(EXCEPTION_KEY_PROPERTY);
  startTime = (Date) entity.getProperty(START_TIME_PROPERTY);
  endTime = (Date) entity.getProperty(END_TIME_PROPERTY);
  childKeys = (List<Key>) entity.getProperty(CHILD_KEYS_PROPERTY);
  if (null == childKeys) {
    childKeys = new LinkedList<>();
  }
  attemptNumber = (Long) entity.getProperty(ATTEMPT_NUM_PROPERTY);
  maxAttempts = (Long) entity.getProperty(MAX_ATTEMPTS_PROPERTY);
  backoffSeconds = (Long) entity.getProperty(BACKOFF_SECONDS_PROPERTY);
  backoffFactor = (Long) entity.getProperty(BACKOFF_FACTOR_PROPERTY);
  queueSettings.setOnBackend((String) entity.getProperty(ON_BACKEND_PROPERTY));
  queueSettings.setOnModule((String) entity.getProperty(ON_MODULE_PROPERTY));
  queueSettings.setModuleVersion((String) entity.getProperty(MODULE_VERSION_PROPERTY));
  queueSettings.setOnQueue((String) entity.getProperty(ON_QUEUE_PROPERTY));
  statusConsoleUrl = (String) entity.getProperty(STATUS_CONSOLE_URL);
  rootJobDisplayName = (String) entity.getProperty(ROOT_JOB_DISPLAY_NAME);
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-pipelines,代码行数:56,代码来源:JobRecord.java

示例8: buildIndex

import com.google.appengine.api.datastore.Text; //导入方法依赖的package包/类
public static int buildIndex(String group) throws IOException{
    //Get all fences of group from DataStore.
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    Key fenceKey = KeyFactory.createKey("Geofence", group);

    Query query = new Query("Fence", fenceKey).addSort("id", Query.SortDirection.DESCENDING);
    List<Entity> fencesFromStore = datastore.prepare(query).asList(FetchOptions.Builder.withDefaults());

    if (!fencesFromStore.isEmpty()) {
    	//Create STRTree-Index.
        STRtree index = new STRtree();
        //Loop through the fences from DataStore.
        for (Entity fenceFromStore : fencesFromStore) {
            long id = (long) fenceFromStore.getProperty("id");
            Gson gson = new Gson();
            Text vText = (Text) fenceFromStore.getProperty("vertices");
            String vString = vText.getValue();
            double[][] vertices = gson.fromJson(vString, double[][].class);

            //Store coordinates in an array.
            Coordinate[] coordinates = new Coordinate[vertices.length];
            int i = 0;
            for(double[] point : vertices){
                Coordinate coordinate = new Coordinate(point[0],point[1]);
                coordinates[i++] = coordinate;
            }
            //Create polygon from the coordinates.
            GeometryFactory fact = new GeometryFactory();
            LinearRing linear = new GeometryFactory().createLinearRing(coordinates);
            MyPolygon polygon = new MyPolygon(linear, null, fact, id);
            //Add polygon to index.
            index.insert(polygon.getEnvelopeInternal(), polygon);
        }
        //Build the index.
        index.build();
        //Write the index to Memcache.
        MemcacheService syncCache = MemcacheServiceFactory.getMemcacheService();
        //Last param is expiration date. Set to null to keep it in Memcache forever.
        syncCache.put(group, index, null); 
    }
    return fencesFromStore.size();
}
 
开发者ID:tschaeff,项目名称:google-geoEngine,代码行数:43,代码来源:MyIndex.java

示例9: isNullOrEmpty

import com.google.appengine.api.datastore.Text; //导入方法依赖的package包/类
/**
 * Determine if an input text is null or empty.
 *
 * @param text Input text that might contain null, empty text or non-empty text
 * @return True if the input text is null or empty; false, the otherwise
 */
public static boolean isNullOrEmpty(Text text) {
  return (text == null || text.getValue() == null || text.getValue().isEmpty());
}
 
开发者ID:googlesamples,项目名称:io2014-codelabs,代码行数:10,代码来源:StringUtility.java


注:本文中的com.google.appengine.api.datastore.Text.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。