choicesView.setItems(FXCollections.observableArrayList new ChoiceModel("Tiger", true), new ChoiceModel("Shark", false), new ChoiceModel("Bear", false), new ChoiceModel("Wolf", true) ));
protected static PrefixedNameSet namesetFromSpecs(boolean nsAware, ContentSpec[] specs) { int len = specs.length; PrefixedName[] nameArray = new PrefixedName[len]; for (int i = 0; i < len; ++i) { nameArray[i] = ((TokenContentSpec)specs[i]).getName(); } if (len < 5) { // 4 or fewer elements -> small return new SmallPrefixedNameSet(nsAware, nameArray); } return new LargePrefixedNameSet(nsAware, nameArray); }
public XMLValidator createValidator(ValidationContext ctxt) throws XMLStreamException { if (mFullyValidating) { return new DTDValidator(this, ctxt, mHasNsDefaults, getElementMap(), getGeneralEntityMap()); } return new DTDTypingNonValidator(this, ctxt, mHasNsDefaults, getElementMap(), getGeneralEntityMap()); }
public ModelNode rewrite() { TokenModel model = new TokenModel(mElemName); if (mArity == '*') { return new StarModel(model); } if (mArity == '?') { return new OptionalModel(model); } if (mArity == '+') { return new ConcatModel(model, new StarModel(new TokenModel(mElemName))); } return model; }
private String readDTDLocalName(char c, boolean checkChar) throws XMLStreamException { /* Let's just check this first, to get better error msg * (parseLocalName() will double-check it too) */ if (checkChar && !isNameStartChar(c)) { throwDTDUnexpectedChar(c, "; expected an identifier"); } return parseLocalName(c); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ public ModelNode cloneModel() { int len = mSubModels.length; ModelNode[] newModels = new ModelNode[len]; for (int i = 0; i < len; ++i) { newModels[i] = mSubModels[i].cloneModel(); } return new ChoiceModel(newModels); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ public ModelNode cloneModel() { return new OptionalModel(mModel.cloneModel()); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ public ModelNode cloneModel() { return new ConcatModel(mLeftModel.cloneModel(), mRightModel.cloneModel()); }
/** * Method that has to create a deep copy of the model, without * sharing any of existing Objects. */ public ModelNode cloneModel() { return new StarModel(mModel.cloneModel()); }
/** * Method called by the validator * to ask attribute to verify that the default it has (if any) is * valid for such type. */ public void validateDefault(InputProblemReporter rep, boolean normalize) throws XMLStreamException { String def = validateDefaultNmToken(rep, normalize); if (normalize) { mDefValue.setValue(def); } } }
protected char dtdNextChar() throws XMLStreamException { return (mInputPtr < mInputEnd) ? mInputBuffer[mInputPtr++] : getNextChar(getErrorMsg()); }
private void handleIncluded() throws XMLStreamException { char c = skipDtdWs(false); if (c != '[') { throwDTDUnexpectedChar(c, "; expected '[' to follow 'INCLUDE' directive"); } ++mIncludeCount; }
public void reportUndeclared(ValidationContext ctxt, XMLValidator dtd) throws XMLStreamException { mUndeclaredEntity.reportUndeclared(ctxt, dtd); }
/** * What DTD reader returns doesn't really matter, so let's just return * perceived start location (different from what stream readers actually * do) */ public final Location getLocation() { return getStartLocation(); }
/** * Rules for reuse are simple: if we can have any number of * repetitions, we can just use a shared root instance. Although * its count variable will get updated this doesn't really * matter as it won't be used. Otherwise a new instance has to * be created always, to keep track of instance counts. */ public StructValidator newInstance() { return (mArity == '*') ? this : new Validator(mArity, mElemName); }
public static DTDSubsetImpl constructInstance(boolean cachable, HashMap genEnt, Set refdGEs, HashMap paramEnt, Set refdPEs, HashMap notations, HashMap elements, boolean fullyValidating) { return new DTDSubsetImpl(cachable, genEnt, refdGEs, paramEnt, refdPEs, notations, elements, fullyValidating); }
private void addUndeclaredEntity(String name, Location loc, boolean isPe) { if (mUndeclaredEntity == null) { mUndeclaredEntity = new UndeclaredEntity(name, loc, isPe); } }
public DTDAttribute cloneWith(int specIndex) { return new DTDEnumAttr(mName, mDefValue, specIndex, mCfgNsAware, mCfgXml11, mEnumValues); }
private void flushFlattenWriter() throws XMLStreamException { mFlattenWriter.flush(mInputBuffer, mInputPtr); }
public void indexTokens(List tokens) { // First, let's ask sub-models to calc their settings for (int i = 0, len = mSubModels.length; i < len; ++i) { mSubModels[i].indexTokens(tokens); } }